-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Queue shutdown #96471
Copy link
Copy link
Open
Labels
type-featureA feature request or enhancementA feature request or enhancement
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement
Fields
Give feedbackNo fields configured for issues without a type.
Add a
shutdownmethod to queue class (threadingqueue,multiprocessing,asyncio) which causes all future puts to raise (aqueue.QueueShutdown) and all future gets once the queue is empty to also raise, unblocking all waiters. An optional argumentimmediate=Truewill skip the requirement for the queue to be empty.This will enable producers and consumers to use the queue to know when to stop. This is important because both producers and consumers can be blocked waiting on the queue.
Previous discussion:
Linked PRs