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.
uvloop.install()
1 parent f24c822 commit a3d8d40Copy full SHA for a3d8d40
uvloop/__init__.py
@@ -1,4 +1,4 @@
1
-import asyncio
+import asyncio as __asyncio
2
3
from asyncio.events import BaseDefaultEventLoopPolicy as __BasePolicy
4
@@ -8,10 +8,10 @@
8
9
10
__version__ = '0.12.0.dev0'
11
-__all__ = ('new_event_loop', 'EventLoopPolicy')
+__all__ = ('new_event_loop', 'install', 'EventLoopPolicy')
12
13
14
-class Loop(__BaseLoop, asyncio.AbstractEventLoop):
+class Loop(__BaseLoop, __asyncio.AbstractEventLoop):
15
pass
16
17
@@ -20,6 +20,11 @@ def new_event_loop():
20
return Loop()
21
22
23
+def install():
24
+ """A helper function to install uvloop policy."""
25
+ __asyncio.set_event_loop_policy(EventLoopPolicy())
26
+
27
28
class EventLoopPolicy(__BasePolicy):
29
"""Event loop policy.
30
0 commit comments