| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -851,8 +851,8 @@ For an example of the usage of queues for interprocess communication see | |||
| 851 | 851 | free slot was available within that time. Otherwise (*block* is | |
| 852 | 852 | ``False``), put an item on the queue if a free slot is immediately | |
| 853 | 853 | available, else raise the :exc:`queue.Full` exception (*timeout* is | |
| 854 | - ignored in that case). Raises :exc:`ShutDown` if the queue has been shut | ||
| 855 | - down. | ||
| 854 | + ignored in that case). Raises the :exc:`queue.ShutDown` if the queue has | ||
| 855 | + been shut down. | ||
| 856 | 856 | ||
| 857 | 857 | .. versionchanged:: 3.8 | |
| 858 | 858 | If the queue is closed, :exc:`ValueError` is raised instead of | |
@@ -871,8 +871,8 @@ For an example of the usage of queues for interprocess communication see | |||
| 871 | 871 | exception if no item was available within that time. Otherwise (block is | |
| 872 | 872 | ``False``), return an item if one is immediately available, else raise the | |
| 873 | 873 | :exc:`queue.Empty` exception (*timeout* is ignored in that case). Raises | |
| 874 | - :exc:`queue.ShutDown` if the queue has been shut down and is empty, or if | ||
| 875 | - the queue has been shut down immediately. | ||
| 874 | + the :exc:`queue.ShutDown` exception if the queue has been shut down and | ||
| 875 | + is empty, or if the queue has been shut down immediately. | ||
| 876 | 876 | ||
| 877 | 877 | .. versionchanged:: 3.8 | |
| 878 | 878 | If the queue is closed, :exc:`ValueError` is raised instead of | |
@@ -884,14 +884,14 @@ For an example of the usage of queues for interprocess communication see | |||
| 884 | 884 | ||
| 885 | 885 | .. method:: shutdown(immediate=False) | |
| 886 | 886 | ||
| 887 | - Shut-down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` | ||
| 887 | + Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` | ||
| 888 | 888 | raise :exc:`queue.ShutDown`. | |
| 889 | 889 | ||
| 890 | 890 | By default, :meth:`~Queue.get` on a shut down queue will only raise once | |
| 891 | 891 | the queue is empty. Set *immediate* to true to make :meth:`~Queue.get` | |
| 892 | 892 | raise immediately instead. | |
| 893 | 893 | ||
| 894 | - All blocked callers of :meth:`~Queue.put` will be unblocked. If | ||
| 894 | + All blocked callers of :meth:`~Queue.put` will be unblocked. If | ||
| 895 | 895 | *immediate* is true, also unblock callers of :meth:`~Queue.get` and | |
| 896 | 896 | :meth:`~Queue.join`. | |
| 897 | 897 | ||
@@ -983,11 +983,12 @@ For an example of the usage of queues for interprocess communication see | |||
| 983 | 983 | items have been processed (meaning that a :meth:`task_done` call was | |
| 984 | 984 | received for every item that had been :meth:`~Queue.put` into the queue). | |
| 985 | 985 | ||
| 986 | + ``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining | ||
| 987 | + item in the queue. | ||
| 988 | + | ||
| 986 | 989 | Raises a :exc:`ValueError` if called more times than there were items | |
| 987 | 990 | placed in the queue. | |
| 988 | 991 | ||
| 989 | - Raises :exc:`queue.ShutDown` if the queue has been shut down immediately. | ||
| 990 | - | ||
| 991 | 992 | ||
| 992 | 993 | .. method:: join() | |
| 993 | 994 | ||
@@ -999,8 +1000,6 @@ For an example of the usage of queues for interprocess communication see | |||
| 999 | 1000 | it is complete. When the count of unfinished tasks drops to zero, | |
| 1000 | 1001 | :meth:`~queue.Queue.join` unblocks. | |
| 1001 | 1002 | ||
| 1002 | - Raises :exc:`queue.ShutDown` if the queue has been shut down immediately. | ||
| 1003 | - | ||
| 1004 | 1003 | ||
| 1005 | 1004 | Miscellaneous | |
| 1006 | 1005 | ^^^^^^^^^^^^^ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -439,6 +439,12 @@ mmap | |||
| 439 | 439 | the file descriptor specified by *fileno* will not be duplicated. | |
| 440 | 440 | (Contributed by Zackery Spytz and Petr Viktorin in :gh:`78502`.) | |
| 441 | 441 | ||
| 442 | + multiprocessing | ||
| 443 | + --------------- | ||
| 444 | + | ||
| 445 | + * Add :meth:`multiprocessing.Queue.shutdown` for queue termination. | ||
| 446 | + (Contributed by Laurie Opperman in :gh:`104230`.) | ||
| 447 | + | ||
| 442 | 448 | opcode | |
| 443 | 449 | ------ | |
| 444 | 450 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments