Currently I can use @async to make a xmlrpc server method asynchronous, but with tornado.gen and friends, I tried to make it so that I could use a @gen.coroutine instead.
I failed to do so, but at least I managed to make it so that if an xmlrpc method returns a Future, it is run asynchronously and its result is returned transparently. I find it quite handy.
As to using gen.coroutines, at least now I can do this:
class RpcHandler(XMLRPCHandler):
def foo(self):
@gen.coroutine
def run():
result1 = yield something(1, 2, 3)
result2 = yield somethingelse(3, 4, 5)
raise gen.Return(result1 + result2)
return run()
Currently I can use @async to make a xmlrpc server method asynchronous, but with tornado.gen and friends, I tried to make it so that I could use a @gen.coroutine instead. I failed to do so, but at least I managed to make it so that if an xmlrpc method returns a Future, it is run asynchronously and its result is returned transparently. I find it quite handy.
As to using gen.coroutines, at least now I can do this: class RpcHandler(XMLRPCHandler): def foo(self): @gen.coroutine def run(): result1 = yield something(1, 2, 3) result2 = yield somethingelse(3, 4, 5) raise gen.Return(result1 + result2) return run()