-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Closed as not planned
Closed as not planned
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Currently consuming items from a queue is very complex. You need to
- use an infinite while loop
- call
queue.task_done()after processing each item - add all worker tasks to a list
- join the queue
- cancel all worker tasks.
- wait until all worker tasks are cancelled
By adding asyncio.Queue.iter() and asyncio.Queue.iter_nowait(), this becomes a lot easier, you only need to call queue.shutdown(). The same applies to synchronous queues.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
Linked PRs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement