I need to change the following legacy tornado code to call an async function async def my_async1(self)
.
class MyHandler(tornado.web.RequestHandler):
@gen.coroutine
def get(self, action):
....
Can they be mixed? How to refactory the code?
class MyHandler(tornado.web.RequestHandler):
@gen.coroutine
async def get(self, action):
....
await self.my_async() # ?
Can I just remove @gen.coroutine
and add async
? Are they exactly the same?