June 2017
Beginner to intermediate
274 pages
6h 49m
English
The asyncio's Queue has both put and get methods as coroutines. So, we need to call them with await and we have to already be in a coroutine to call them, unless we were to actually use the ensure_future function to launch them as separate tasks as shown in the following code example of the Queue class:

However, the Queue class also has methods called put_nowait and get_nowait, which are not coroutines, and can be called from anywhere. This makes the Queue class quite useful for communicating new data to a system of coroutines as well as sending data between coroutine tasks.
Read now
Unlock full access