Tornado, run coroutine method with arguments from synchronous code
According to several examples on the web, to run asynchronous methods decorated with tornado.gen.coroutine from synchronous code, you can use the following:
@tornado.gen.coroutine
def do_something():
do_something
if __name__ == "__main__":
tornado.ioloop.IOLoop.instance().run_sync(do_something)
However, if you have arguments for the coroutine method, is there a way to run it?
+3
source to share