bpo-43352: Add a Barrier object in asyncio lib (GH-24903)

Co-authored-by: Yury Selivanov <yury@edgedb.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
Duprat 2022-03-25 23:01:21 +01:00 committed by GitHub
parent 20e6e5636a
commit d03acd7270
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 856 additions and 5 deletions

View file

@ -186,11 +186,16 @@ Threading-like synchronization primitives that can be used in Tasks.
* - :class:`BoundedSemaphore`
- A bounded semaphore.
* - :class:`Barrier`
- A barrier object.
.. rubric:: Examples
* :ref:`Using asyncio.Event <asyncio_example_sync_event>`.
* :ref:`Using asyncio.Barrier <asyncio_example_barrier>`.
* See also the documentation of asyncio
:ref:`synchronization primitives <asyncio-sync>`.
@ -206,6 +211,9 @@ Exceptions
* - :exc:`asyncio.CancelledError`
- Raised when a Task is cancelled. See also :meth:`Task.cancel`.
* - :exc:`asyncio.BrokenBarrierError`
- Raised when a Barrier is broken. See also :meth:`Barrier.wait`.
.. rubric:: Examples