summaryrefslogtreecommitdiff
path: root/aiogreen.py
diff options
context:
space:
mode:
Diffstat (limited to 'aiogreen.py')
-rw-r--r--aiogreen.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/aiogreen.py b/aiogreen.py
index f2ee377..88bdab3 100644
--- a/aiogreen.py
+++ b/aiogreen.py
@@ -32,6 +32,14 @@ if eventlet.patcher.is_monkey_patched('socket'):
asyncio.unix_events.threading = threading
# FIXME: patch also trollius.py3_ssl
+ # BaseDefaultEventLoopPolicy._Local must inherit from threading.local
+ # of the original threading module, not the patched threading module
+ class _Local(threading.local):
+ _loop = None
+ _set_called = False
+
+ asyncio.events.BaseDefaultEventLoopPolicy._Local = _Local
+
_EVENT_READ = asyncio.selectors.EVENT_READ
_EVENT_WRITE = asyncio.selectors.EVENT_WRITE
_HUB_READ = eventlet.hubs.hub.READ