mirror of
https://github.com/django/daphne.git
synced 2025-07-27 15:39:46 +03:00
Set tell asyncio which is the current event loop
This commit is contained in:
parent
18f2d67f34
commit
82565eec05
|
@ -5,6 +5,7 @@ import warnings # isort:skip
|
||||||
from twisted.internet import asyncioreactor # isort:skip
|
from twisted.internet import asyncioreactor # isort:skip
|
||||||
|
|
||||||
twisted_loop = asyncio.new_event_loop()
|
twisted_loop = asyncio.new_event_loop()
|
||||||
|
asyncio.set_event_loop(twisted_loop)
|
||||||
current_reactor = sys.modules.get("twisted.internet.reactor", None)
|
current_reactor = sys.modules.get("twisted.internet.reactor", None)
|
||||||
if current_reactor is not None:
|
if current_reactor is not None:
|
||||||
if not isinstance(current_reactor, asyncioreactor.AsyncioSelectorReactor):
|
if not isinstance(current_reactor, asyncioreactor.AsyncioSelectorReactor):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user