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

@ -1,7 +1,8 @@
"""asyncio exceptions."""
__all__ = ('CancelledError', 'InvalidStateError', 'TimeoutError',
__all__ = ('BrokenBarrierError',
'CancelledError', 'InvalidStateError', 'TimeoutError',
'IncompleteReadError', 'LimitOverrunError',
'SendfileNotAvailableError')
@ -55,3 +56,7 @@ class LimitOverrunError(Exception):
def __reduce__(self):
return type(self), (self.args[0], self.consumed)
class BrokenBarrierError(RuntimeError):
"""Barrier is broken by barrier.abort() call."""