uvloop targets asyncio specifically but given that Tornado _can_ use asyncio as the main event loop [1] [2] it looks like integrating the 3 (tornado + asyncio loop + uvloop) could be possible, and perhaps also fairly easily.
I haven't looked into uvloop code specifically but given that the tornado -> asyncio loop bridge is already in place in tornado's code, such an integration could already be possible in principle, in which case the proposal is to investigate how to "enable it" and document it (possibly in both projects).
[1] http://www.tornadoweb.org/en/stable/asyncio.html
[2] https://github.com/MagicStack/uvloop/issues/9
From the looks of it, all you need to do is to set up uvloop asyncio policy before installing AsyncIOMainLoop:
from tornado.platform.asyncio import AsyncIOMainLoop
import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
AsyncIOMainLoop().install()
asyncio.get_event_loop().run_forever()
Please check if that works.
Yes, it looks like that just works.
Thank you Ben for checking that. Closing this issue now.
Most helpful comment
From the looks of it, all you need to do is to set up uvloop asyncio policy before installing
AsyncIOMainLoop:Please check if that works.