diff options
author | Victor Stinner <vstinner@python.org> | 2020-04-27 16:11:10 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 16:11:10 (GMT) |
commit | 9adccc1384568f4d46e37f698cb3e3a4f6ca0252 (patch) | |
tree | f12424600659c0171b2f70f6ab97060c9a31b977 /Doc/library | |
parent | c5c42815ecb560bbf34db99b0e15fe9b604be889 (diff) | |
download | cpython-9adccc1384568f4d46e37f698cb3e3a4f6ca0252.zip cpython-9adccc1384568f4d46e37f698cb3e3a4f6ca0252.tar.gz cpython-9adccc1384568f4d46e37f698cb3e3a4f6ca0252.tar.bz2 |
bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)
Add a new close() method to multiprocessing.SimpleQueue to explicitly
close the queue.
Automerge-Triggered-By: @pitrou
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/multiprocessing.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst index ec9521f..50b9003 100644 --- a/Doc/library/multiprocessing.rst +++ b/Doc/library/multiprocessing.rst @@ -878,6 +878,16 @@ For an example of the usage of queues for interprocess communication see It is a simplified :class:`Queue` type, very close to a locked :class:`Pipe`. + .. method:: close() + + Close the queue: release internal resources. + + A queue must not be used anymore after it is closed. For example, + :meth:`get`, :meth:`put` and :meth:`empty` methods must no longer be + called. + + .. versionadded:: 3.9 + .. method:: empty() Return ``True`` if the queue is empty, ``False`` otherwise. |