Here are the examples of the python api twisted.internet.asyncioreactor.install taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
0
Source : utils.py
with GNU General Public License v3.0
from CPChain
with GNU General Public License v3.0
from CPChain
def _install_reactor():
reactor_qual_name = "twisted.internet.reactor"
import sys
if reactor_qual_name not in sys.modules:
if config.core.mode == "proxy":
import asyncio
from twisted.internet import asyncioreactor
loop = asyncio.get_event_loop()
asyncioreactor.install(eventloop=loop)
elif config.core.mode == "wallet":
import asyncio
from quamash import QEventLoop, QThreadExecutor
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
from twisted.internet import asyncioreactor
asyncioreactor.install(eventloop=loop)
from twisted.internet import reactor
else:
import asyncio
from quamash import QEventLoop, QThreadExecutor
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
from twisted.internet import asyncioreactor
import twisted.internet
reactor = asyncioreactor.AsyncioSelectorReactor(loop)
twisted.internet.reactor = reactor
sys.modules[reactor_qual_name] = reactor
return sys.modules.get(reactor_qual_name)
reactor = _install_reactor()
0
Source : twisted.py
with GNU General Public License v3.0
from migaku-official
with GNU General Public License v3.0
from migaku-official
def install() -> None:
"""Install ``AsyncioSelectorReactor`` as the default Twisted reactor.
.. deprecated:: 5.1
This function is provided for backwards compatibility; code
that does not require compatibility with older versions of
Tornado should use
``twisted.internet.asyncioreactor.install()`` directly.
.. versionchanged:: 6.0.3
In Tornado 5.x and before, this function installed a reactor
based on the Tornado ``IOLoop``. When that reactor
implementation was removed in Tornado 6.0.0, this function was
removed as well. It was restored in Tornado 6.0.3 using the
``asyncio`` reactor instead.
"""
from twisted.internet.asyncioreactor import install
install()
if hasattr(gen.convert_yielded, "register"):