File tree 2 files changed +8
-0
lines changed 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,10 @@ Synchronous Methods:
205
205
* ` is_set ` No args. Returns ` True ` if the event is set.
206
206
* ` value ` No args. Returns the value passed to ` set ` .
207
207
208
+ Asynchronous Method:
209
+ * ` wait ` For CPython compatibility. Pause until event is set. The CPython
210
+ Event is not awaitable.
211
+
208
212
The optional data value may be used to compensate for the latency in awaiting
209
213
the event by passing ` loop.time() ` .
210
214
Original file line number Diff line number Diff line change @@ -104,6 +104,10 @@ def clear(self):
104
104
self ._flag = False
105
105
self ._data = None
106
106
107
+ async def wait (self ): # CPython comptaibility
108
+ while not self ._flag :
109
+ await asyncio .sleep_ms (self .delay_ms )
110
+
107
111
def __await__ (self ):
108
112
while not self ._flag :
109
113
await asyncio .sleep_ms (self .delay_ms )
You can’t perform that action at this time.
0 commit comments