-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
promise/promise/schedulers/asyncio.py
Lines 13 to 22 in ad8ebe6
def wait(self, promise, timeout=None): | |
e = Event() | |
def on_resolve_or_reject(_): | |
e.set() | |
promise._then(on_resolve_or_reject, on_resolve_or_reject) | |
# We can't use the timeout in Asyncio event | |
e.wait() |
As per the docs, the Event.wait()
method returns a coroutine. So in order to block function execution it would need to be await
ed from another coroutine.
The end result is that the Promise.get()
method always returns None
when using the AsyncioScheduler
unless the promise was previously fulfilled.
ruohola and 0xD09CD196D188D0B0
Metadata
Metadata
Assignees
Labels
No labels