March 2019
Beginner
490 pages
12h 40m
English
One of the most important elements in asyncio are futures, which represent a process that has not yet finished. A future is an object that is supposed to have a result in the future and represents uncompleted tasks.
A good example for starting with asyncio is collecting all of the responses from its URL list and performing post-processing on them. In the following example, we are using an asyncio future object and passing whole lists of future objects as tasks to be executed in the loop. Each future is a task that is going to be executed in the loop.
You can find the following code in the future_example.py ...
Read now
Unlock full access