Class Event

Distributed Centralized Event equivalent to asyncio.Event

Declaration

class Event
source link

Documentation

An event stores a single flag, which is set to false on start.
The flag can be set to true (using the set() call) or back to false
(with the clear() call).
Every call to wait() blocks until the event flag is set to true.

Attributes

Examples

>>> event_1 = Event('a')  # doctest: +SKIP
>>> event_1.wait(timeout=1)  # doctest: +SKIP
>>> # in another process
>>> event_2 = Event('a')  # doctest: +SKIP
>>> event_2.set() # doctest: +SKIP
>>> # now event_1 will stop waiting

Methods

Reexports