syrusakbary / promise

Ultra-performant Promise implementation in Python
MIT License
362 stars 76 forks source link

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

Open minznerjosh opened 4 years ago

minznerjosh commented 4 years ago

https://github.com/syrusakbary/promise/blob/ad8ebe68cd9c9686793e3449457f175a0fe43226/promise/schedulers/asyncio.py#L13-L22

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.