Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 988 Bytes

asyncio.rst

File metadata and controls

28 lines (20 loc) · 988 Bytes

asyncio

2.0

Scrapy has partial support asyncio. After you install the asyncio reactor <install-asyncio>, you may use asyncio and asyncio-powered libraries in any coroutine <coroutines>.

Warning

asyncio support in Scrapy is experimental. Future Scrapy versions may introduce related changes without a deprecation period or warning.

Installing the asyncio reactor

To enable asyncio support, set the TWISTED_REACTOR setting to 'twisted.internet.asyncioreactor.AsyncioSelectorReactor'.

If you are using ~scrapy.crawler.CrawlerRunner, you also need to install the ~twisted.internet.asyncioreactor.AsyncioSelectorReactor reactor manually. You can do that using ~scrapy.utils.reactor.install_reactor:

install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')