Bug #1404

Updated by D. Klotz over 11 years ago

It is impossible to register a method that does not return a value for RPC servers created in Python, because there does not seem to be a counterpart of the VoidType used for this purpose in other languages.

The addMethod call on a (local) server object in Python has a default value of 'object' for the replyType parameter. This creates a problem because by default, there is no converter available for type 'object'.

This leads to the problem that when you try to register a method like in the following example, the server throws a (not very helpful non-descriptive "KeyError") exception when the registered method is called by a client:

<pre>[...]
def say(sentence):
print("Saying: '%s'" % sentence)

if __name__ == '__main__':
server = rsb.createServer("/foo/bar")
server.addMethod("say", say, str)
[...]</pre>

In the end, there should be way to register a method that does not return a value. why not use pythons NoneType for this? And IMHO this type should then be the default for the replyType parameter of server.addMethod, or it should not have a default parameter value at all (since the unusable default of ob 'object' is quite misleading).

Back