Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
minznerjosh opened this issue Jan 3, 2020 · 0 comments
Open

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

minznerjosh opened this issue Jan 3, 2020 · 0 comments

Comments

@minznerjosh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant