Ben Darnell <ben.darn...@gmail.com> added the comment:

> Would it be acceptable for you to *require* use of uvloop when Tornado is 
> used with AsyncIO?

How, exactly? Adding the dependency is no problem, but AFAIK I'd still be stuck 
with an import-time side effect to set the event loop policy (or a .pth file 
hack, I guess). Maybe an import-time side effect that chooses uvloop is better 
since it's a functional superset of the two default windows event loops, but 
setting the policy at import time still has its problems (What if another 
module has initialized the event loop before tornado is imported? What if 
someone also wants to set a custom policy to work around asyncio's strict "only 
on the main thread" defaults?)

That's why I started this thread not asking for a proactor+selector hybrid 
event loop, but a better way to *configure* the event loop because policies 
aren't really doing the job in this case. 

> I considered using the `selectors` module directly, but it's not as simple as 
> it sounds.

FWIW, I've reconsidered this. Treating SelectorEventLoop as a black box means 
you don't have enough control over synchronization and it's hard to avoid 
spurious wakeups and busy loops on the selector thread. I have a (broken) 
prototype using SelectorEventLoop that I plan to rewrite to call select.select 
directly.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37373>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to