mirror of https://github.com/scrapy/scrapy.git
29 lines
988 B
ReStructuredText
29 lines
988 B
ReStructuredText
=======
|
|
asyncio
|
|
=======
|
|
|
|
.. versionadded:: 2.0
|
|
|
|
Scrapy has partial support :mod:`asyncio`. After you :ref:`install the asyncio
|
|
reactor <install-asyncio>`, you may use :mod:`asyncio` and
|
|
:mod:`asyncio`-powered libraries in any :doc:`coroutine <coroutines>`.
|
|
|
|
.. warning:: :mod:`asyncio` support in Scrapy is experimental. Future Scrapy
|
|
versions may introduce related changes without a deprecation
|
|
period or warning.
|
|
|
|
.. _install-asyncio:
|
|
|
|
Installing the asyncio reactor
|
|
==============================
|
|
|
|
To enable :mod:`asyncio` support, set the :setting:`TWISTED_REACTOR` setting to
|
|
``'twisted.internet.asyncioreactor.AsyncioSelectorReactor'``.
|
|
|
|
If you are using :class:`~scrapy.crawler.CrawlerRunner`, you also need to
|
|
install the :class:`~twisted.internet.asyncioreactor.AsyncioSelectorReactor`
|
|
reactor manually. You can do that using
|
|
:func:`~scrapy.utils.reactor.install_reactor`::
|
|
|
|
install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')
|