class asyncio.Event(*, loop=None)
An Event implementation, asynchronous equivalent to threading.Event
.
Class implementing event objects. An event manages a flag that can be set to true with the set()
method and reset to false with the clear()
method. The wait()
method blocks until the flag is true. The flag is initially false.
This class is not thread safe.
-
clear()
-
Reset the internal flag to false. Subsequently, coroutines calling
wait()
will block untilset()
is called to set the internal flag to true again.
-
is_set()
-
Return
True
if and only if the internal flag is true.
-
set()
-
Set the internal flag to true. All coroutines waiting for it to become true are awakened. Coroutine that call
wait()
once the flag is true will not block at all.
Please login to continue.