We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3263aaf commit 0dcfe0fCopy full SHA for 0dcfe0f
Doc/library/asyncio-eventloop.rst
@@ -1611,9 +1611,12 @@ on Unix and :class:`ProactorEventLoop` on Windows.
1611
import asyncio
1612
import selectors
1613
1614
- selector = selectors.SelectSelector()
1615
- loop = asyncio.SelectorEventLoop(selector)
1616
- asyncio.set_event_loop(loop)
+ class MyPolicy(asyncio.DefaultEventLoopPolicy):
+ def new_event_loop(self):
+ selector = selectors.SelectSelector()
1617
+ return asyncio.SelectorEventLoop(selector)
1618
+
1619
+ asyncio.set_event_loop_policy(MyPolicy())
1620
1621
1622
.. availability:: Unix, Windows.
0 commit comments