application_test.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tailsocket 作者: yeraydiazdiaz 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号