Closed julioasotodv closed 7 years ago
The Tornado server implemented by thriftpy is asynchronous(using tornado.tcpserver.TCPServer
). You can define methods with @gen.coroutine
decorator or methods returning Future
object.
class Dispatcher(object):
@gen.coroutine
def ping(self):
yield gen.sleep(10)
raise gen.Return("pong")
Hi,
Yes, you are definetly right. I tried it before, but the problem was that I was trying to send lots of calls in parallel, but from the same client (which isn't async), so I couldn't be able to get benefit from async server side code.
Thank you very much. Great library btw :)
I am trying to run the example in the docs (in
tornado.py
):This isn't asynchronous Tornado code (since there is no
@coroutine
decorator in theDispatcher
class, and it actuallty returns as any simple function).Can be thriftpy's Tornado server asynchronous in any way?