0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
704 stars 166 forks source link

Servers - Adding methods after instantiation. #74

Closed jacktuck closed 8 years ago

jacktuck commented 8 years ago

Is it possible to add methods to the server once instantiated?

Something like this, perhaps:

var zerorpc = require("zerorpc");

var server = new zerorpc.Server();

server.add('addMan', function(sentence, reply) {
  reply(null, sentence + ", man!");
})

If not currently possible, would you be open to a PR to add such functionality?

bombela commented 8 years ago

It is not possible, and not intended to be. When a service is running, its API shouldn't change. That's a design decision to keep things simpler across languages.

Why would you want such functionality? What are you trying to achieve?