with tornado.gen.Task, we can easily write AsyncHandler like the following code, but can anyone tell me how to make Multiple Asynchronous Requests with tornado.gen.Task ? What should I add to the following code?
import tornado.ioloop
import tornado.web
import tornado.gen
import tornado.httpclient
class GenAsyncHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
def get(self):
http_client = tornado.httpclient.AsyncHTTPClient()
self.finish('Fin.')
application = tornado.web.Application([
(r"/", GenAsyncHandler),
])
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()