Skip to content

Commit df26807

Browse files
committed
style(scrapy): tighten comments and docstrings
1 parent 9854382 commit df26807

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/apify/scrapy/_async_thread.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
class AsyncThread:
1717
"""Run an asyncio event loop in a dedicated background thread.
1818
19-
This lets synchronous Scrapy callbacks drive asynchronous Apify and Crawlee coroutines. Each
20-
consumer (the scheduler and the HTTP cache storage) owns its own `AsyncThread`, so the request
21-
queue and the key-value store each live entirely on a single, separate event loop and are never
22-
shared across loops. They do read the same global `Configuration`, which is read-only here, so
23-
the isolation holds. A single shared loop would also work but would couple the otherwise
24-
independent lifecycles of those Scrapy components.
19+
This lets synchronous Scrapy callbacks drive asynchronous Apify and Crawlee coroutines. The
20+
scheduler and the HTTP cache storage each own their own `AsyncThread`, so the request queue and
21+
the key-value store never share an event loop; they only share the read-only global
22+
`Configuration`. A single shared loop would also work but would couple their lifecycles.
2523
"""
2624

2725
def __init__(self, default_timeout: timedelta = timedelta(seconds=60)) -> None:

0 commit comments

Comments
 (0)