Today, I'll introduce how to use asynchronous programming in Python. This article focuses on the usage of asynchronous programming, so it won't delve too much into underlying concepts.
Brief Introduction to Concepts
- Coroutine: A special function marked with
async
that can execute code asynchronously. - Event Loop: The core of Python asynchronous programming, responsible for scheduling coroutines.
- Future: A low-level object representing the eventual result of an asynchronous operation.
- Task: A wrapper for Future that can encapsulate coroutines and supports operations like cancellation.
5/9/25About 7 min