pomelo-rpc
pomelo-rpc copied to clipboard
1.x can only notify. ignore client and server callback function.
// remote service
module.exports = function(context) {
return {
echo: function(msg, cb) {
cb(null, 'echo: ' + msg);
},
onlynotify:function(msg,cb){
//cb is undefined.
console.log('receive notify..:',cb,msg);
}
};
};
//client
client.proxies.user.test.service.onlynotify(routeParam, msg[Math.round(Math.random()*(10-1))] + '::' + id++);
//no callback function