June 2017
Beginner to intermediate
274 pages
6h 49m
English
What the gather coroutine does is it takes a bunch of futures and converts them into a single future that will be completed when all the subfutures are completed along with the result in the list of the subfutures' results, as shown in the following code example:

There are a bunch of uses for something like that, but one very nice thing we can do with it is use it to construct the future that we pass into run_until_complete.
In effect, we're telling asyncio that it should run until all these futures are complete. Futures are great for communicating a one-off value between tasks, and events objects are good for sending ...
Read now
Unlock full access