summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-30 00:37:04 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-30 00:37:04 +0100
commit7299178a8190ae59e48390723ef9d5c9ab7408e1 (patch)
tree656920af8275aa4b63fd35efaa0b1681ad67d59b /Doc
parentb010e17aa67edfa97618893f0539ffc8802d1982 (diff)
downloadcpython-7299178a8190ae59e48390723ef9d5c9ab7408e1.tar.gz
Issue #21962, asyncio doc: Suggest the usage of wait_for() to replace
the lack of timeout parameter for locks and queues.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/asyncio-sync.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
index c63447bbab..4cc9a9645c 100644
--- a/Doc/library/asyncio-sync.rst
+++ b/Doc/library/asyncio-sync.rst
@@ -4,6 +4,29 @@
Synchronization primitives
==========================
+Locks:
+
+* :class:`Lock`
+* :class:`Event`
+* :class:`Condition`
+* :class:`Semaphore`
+* :class:`BoundedSemaphore`
+
+Queues:
+
+* :class:`Queue`
+* :class:`PriorityQueue`
+* :class:`LifoQueue`
+* :class:`JoinableQueue`
+
+asyncio locks and queues API were designed to be close to classes of the
+:mod:`threading` module (:class:`~threading.Lock`, :class:`~threading.Event`,
+:class:`~threading.Condition`, :class:`~threading.Semaphore`,
+:class:`~threading.BoundedSemaphore`) and the :mod:`queue` module
+(:class:`~queue.Queue`, :class:`~queue.PriorityQueue`,
+:class:`~queue.LifoQueue`), but they have no *timeout* parameter. The
+:func:`asyncio.wait_for` function can be used to cancel a task after a timeout.
+
Locks
-----