I have this code:
done, pending = asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)
But it fails:
Traceback (most recent call last):
...
File "/.../api.py", line 83, in websockets_handler
return_when=asyncio.FIRST_COMPLETED)
TypeError: cannot unpack non-iterable coroutine object
Well, there should be await
in front of asyncio.wait
:)
done, pending = await asyncio.wait(
[a, b],
return_when=asyncio.FIRST_COMPLETED)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With