Skip to content

Commit

Permalink
docs: avoid mentioning blocking the event loop in async implementation
Browse files Browse the repository at this point in the history
I think I was conflating a few different things when writing about avoiding
blocking the event loop as a reason for using threads in the async
implementation.

The reasoning for using threads is more:

- async_stream_zip takes async iterables
- which means if delegating to stream_zip, it would need to call async
  functions like anext or __anext__ from sync functions, and wait for them to
  complete.
- there is only really one choice for this that works/avoids deadlock:
  run_coroutine_threadsafe.
- which means this call must be in a different thread
  • Loading branch information
michalc committed Feb 25, 2024
1 parent f558cb0 commit 07be1b3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In addition to being memory efficient (with some [limitations](https://stream-zi

- By default stores modification time as an extended timestamp. An extended timestamp is a more accurate timestamp than the original ZIP format allows

- Provides an async interface (that uses threads under the hood to share code with the sync interface without blocking the event loop)
- Provides an async interface (that uses threads under the hood)

<!-- --8<-- [end:features] -->

Expand Down
2 changes: 1 addition & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ In addition to being memory efficient (with some [limitations](/get-started/#lim

- By default stores modification time as an extended timestamp. An extended timestamp is a more accurate timestamp than the original ZIP format allows

- Provides an async interface (that uses threads under the hood to share code with the sync interface without blocking the event loop)
- Provides an async interface (that uses threads under the hood)

0 comments on commit 07be1b3

Please sign in to comment.