Based on discussion in https://github.com/python/cpython/issues/100160, we should not be relying on asyncio.get_event_loop, since they are in fact going to make it an alias for asyncio.get_running_loop.
Based on results in https://github.com/ipython/ipykernel/pull/1184, we'll want to normally use the default event loop on Windows, unless we know we're running a tornado app. This PR adds a prefer_selector_loop option to get_event_loop so we can override _prefer_selector_loop in jupyter_server apps to prefer the selector loop.
Based on discussion in https://github.com/python/cpython/issues/100160, we should not be relying on
asyncio.get_event_loop
, since they are in fact going to make it an alias forasyncio.get_running_loop
.As of #381, we are starting the event loop before instantiating our apps, so we should not see any more issues like https://github.com/jupyter/notebook/issues/6721.
Based on results in https://github.com/ipython/ipykernel/pull/1184, we'll want to normally use the default event loop on Windows, unless we know we're running a tornado app. This PR adds a
prefer_selector_loop
option toget_event_loop
so we can override_prefer_selector_loop
injupyter_server
apps to prefer the selector loop.