def get_new_ioloop(self):
"""Override the creation of the IOLoop mimicking that of application.
The result needs to be a Tornado IOLoop instance, we first configure
the asyncio loop and then call IOLoop configure to use it.
"""
if sys.platform == 'linux':
selector = selectors.SelectSelector()
loop = asyncio.SelectorEventLoop(selector)
asyncio.set_event_loop(loop)
IOLoop.configure('tornado.platform.asyncio.AsyncIOLoop')
return IOLoop.current()
评论列表
文章目录