-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hi there!
Thanks for this neat library. I'm giving it a go.
It would be great to have two variants of the chunkerify
function that return a generator and async generator, and a version that is async.
Use cases:
- async evaluation is good for non-blocking situations, for example - chunking dynamically inside a web request, which in a blocking (sync scenario) will impact the backend service as a whole in some cases. Furthermore, it could allow for creating a concurrent (not parallel) version of chunking perhaps.
- returning a generator allows evaluating in intervals and executing code in between, for example - a for loop.
- returning an async generator offers the same, within an async context.
The simplest option (but non performant) version for implementing async logic, is simply to execute the sync version using something like anyio.to_thread.run_sync
: https://anyio.readthedocs.io/en/stable/threads.html.
Metadata
Metadata
Assignees
Labels
No labels