Hi,
I am following the example at https://github.com/dcodeIO/protobuf.js/wiki/Services and creating my RPC.
Everything seems fine but I cannot create a new instance of Service. it says:
Service is not a constructor
var Service = root.lookup('MailService');
var RequestType = root.lookup('RequestType');
var ResponseType = root.lookup('ResponseType');
function rpcHandler(method, req, callback) {
var request = RequestType.decode(data);
var response = new ResponseType();
if(method === '.MailService.addMailbox') {
// add mailbox
} else if(method === '.MailService.removeMailbox') {
// remove mailbox
}
callback(response.toBuffer());
}
var srv = new Service(rpcHandler); // CRASH
Hi,
I am following the example at https://github.com/dcodeIO/protobuf.js/wiki/Services and creating my RPC.
Everything seems fine but I cannot create a new instance of Service. it says: