PyDocs

Nav

Networking and Interprocess Communication

Barrier

asyncio

class · Added in 3.11 (source) not WASI
  • Barrier(parties)
Asyncio equivalent to threading.Barrier

Implements a Barrier primitive.
Useful for synchronizing a fixed number of tasks at known synchronization
points. Tasks block on 'wait()' and are simultaneously awoken once they
have all made their call.
Members of Barrier

a

abort
Place the barrier into a 'broken' state.

b

broken
Return True if the barrier is in a broken state.

n

n_waiting
Return the number of tasks currently waiting at the barrier.

p

parties
Return the number of tasks required to trip the barrier.

r

reset
Reset the barrier to the initial state.

w

wait
Wait for the barrier.
0 Examples
No examples for asyncio/Barrier.
See Also
No see-alsos for asyncio/Barrier
0 Notes
No notes for Barrier