Task manipulation with Asyncio

Asyncio is designed to handle asynchronous processes and concurrent task executions on an event loop. It also provides us with the asyncio.Task() class for the purpose of wrapping coroutines in a task. Its use is to allow independently running tasks to run concurrently with other tasks on the same event loop. When a coroutine is wrapped in a task, it connects the task to the event loop and then runs automatically when the loop is started, thus providing a mechanism to automatically drive the coroutine.

Getting ready

The Asyncio module provides us with the asyncio.Task(coroutine) method to handle computations with tasks. It schedules the execution of a coroutine. A task is responsible for the execution of a coroutine ...

Get Python Parallel Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.