Author Ben.Darnell
Recipients Ben.Darnell, Big Stone, asvetlov, carltongibson, lukasz.langa, mikeshardmind, njs, steve.dower, yselivanov
Date 2020-02-25.18:58:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I considered using the `selectors` module directly, but it's not as simple as it sounds. Using the low-level interface means you need to also use a self-waker-pipe (or socket on windows) and manage a queue analogous to that used by `call_soon_threadsafe`. We already have two implementations of this pattern in asyncio with subtle differences between them (such as this one i just found: In the end you'd have to duplicate a non-trivial portion of SelectorEventLoop. 

While there might be some efficiency gains to be had by working directly with the lower-level interface (and avoiding some redundancies between the two threads' event loops), I think the most robust/safest option is to use the well-tested SelectorEventLoop so that the only new code is what's needed to pass things back and forth between threads.
Date User Action Args
2020-02-25 18:58:15Ben.Darnellsetrecipients: + Ben.Darnell, njs, asvetlov, lukasz.langa, yselivanov, steve.dower, Big Stone, mikeshardmind, carltongibson
2020-02-25 18:58:15Ben.Darnellsetmessageid: <>
2020-02-25 18:58:15Ben.Darnelllinkissue37373 messages
2020-02-25 18:58:15Ben.Darnellcreate