June 2017
Beginner to intermediate
274 pages
6h 49m
English
The wait coroutine still waits for a group of futures to end with an optional timeout and returns a list of futures that are ready and a list of futures that are not ready when the time expires. The as_completed function still takes a list of futures and produces futures of the results in the order that the results become available. Then, we extract the actual values from the futures with wait and we are good to go.
As shown in the following code example, there's no telling in which order the results will become available; however, each time a value does become available, it gets printed:

asyncio provides some other interesting ...
Read now
Unlock full access