Example usage:
from twisted.internet import defer from txjason import handler from txjason.netstring import JSONRPCServerFactory class Example(handler.Handler): # export the echo2 method as 'echo' @handler.exportRPC('echo') def echo2(self, param): return param # exported methods may return a deferred @handler.exportRPC() def deferred_echo(self, param): return defer.succeed(param) factory = JSONRPCServerFactory() factory.addHandler(Example(), namespace='main')