Thanks to visit codestin.com Credit goes to github.com
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 a120b9f commit 53503ffCopy full SHA for 53503ff
1 file changed
Doc/library/asyncio-eventloop.rst
@@ -1632,9 +1632,12 @@ on Unix and :class:`ProactorEventLoop` on Windows.
1632
import asyncio
1633
import selectors
1634
1635
- selector = selectors.SelectSelector()
1636
- loop = asyncio.SelectorEventLoop(selector)
1637
- asyncio.set_event_loop(loop)
+ class MyPolicy(asyncio.DefaultEventLoopPolicy):
+ def new_event_loop(self):
+ selector = selectors.SelectSelector()
1638
+ return asyncio.SelectorEventLoop(selector)
1639
+
1640
+ asyncio.set_event_loop_policy(MyPolicy())
1641
1642
1643
.. availability:: Unix, Windows.
0 commit comments