Asyncio provides another tool for concurrent programming in Python, that is more lightweight than threads or multiprocessing. In a very simple sense it does this by having an event loop execute a collection of tasks, with a key difference being that each task chooses when to yield control back to the event loop.1
Philip Jones, Medium
The Asyncio API in Python is complex because it aims to solve
different problems for different groups of people. Unfortunately,
there is very little guidance available to help you figure out which
asyncio are important for the group you’re in.
My goal is to help you figure that out. There are two main target audiences for the async features in Python:
These want to make applications using
asyncio. I am going to assume that you’re in this group.
These want to make frameworks and libraries that end-user developers can use in their applications.
Much of the confusion around
asyncio in the community today is due
to confusion between these two goals. For instance, the documentation
asyncio in the official Python documentation is more appropriate
for framework developers, not end users. This means that end-user
developers reading those docs quickly become shell-shocked by the
apparent complexity. You’re somewhat forced to take it all in before
being able to do anything with it.
It is my hope that this book can help to separate, in your mind, the