Skip to content

AsyncioScheduler wait() method doesn't actually wait #83

@minznerjosh

Description

@minznerjosh

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 awaited 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions