Skip to content

Commit

Permalink
chore: Add comment about AsyncioSelectorReactor and nest_asyncio
Browse files Browse the repository at this point in the history
…order
  • Loading branch information
fnesveda committed Apr 17, 2024
1 parent 6ef7254 commit c44a3d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/python-scrapy/src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def new_configure_logging(*args: Any, **kwargs: Any) -> None:

# To ensure seamless compatibility between asynchronous libraries Twisted (used by Scrapy) and AsyncIO (used by Apify),
# it is highly recommended to use AsyncioSelectorReactor as the Twisted reactor
# The reactor installation must be done manually before calling `nest_asyncio.apply()`,
# otherwise, it will not work correctly on Windows.
install_reactor('twisted.internet.asyncioreactor.AsyncioSelectorReactor')
nest_asyncio.apply()

Expand Down

0 comments on commit c44a3d7

Please sign in to comment.