gh-96471: Correct docs for queue shutdown (#115838)

This commit is contained in:
Laurie O 2024-02-26 02:53:21 +10:00 committed by GitHub
parent a0a8d9ffe0
commit 9402ea63f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 11 deletions

View file

@ -187,11 +187,12 @@ fully processed by daemon consumer threads.
processed (meaning that a :meth:`task_done` call was received for every item
that had been :meth:`put` into the queue).
``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item
in the queue.
Raises a :exc:`ValueError` if called more times than there were items placed in
the queue.
Raises :exc:`ShutDown` if the queue has been shut down immediately.
.. method:: Queue.join()
@ -202,8 +203,6 @@ fully processed by daemon consumer threads.
indicate that the item was retrieved and all work on it is complete. When the
count of unfinished tasks drops to zero, :meth:`join` unblocks.
Raises :exc:`ShutDown` if the queue has been shut down immediately.
Example of how to wait for enqueued tasks to be completed::