asyncioAsynchronous异步 I/O


asyncio is a library to write concurrent code using the async/await syntax.是一个使用异步/等待语法编写并发代码的库。

asyncio is used as a foundation for multiple Python asynchronous frameworks that provide high-performance network and web-servers, database connection libraries, distributed task queues, etc.用作提供高性能网络和web服务器、数据库连接库、分布式任务队列等的多个Python异步框架的基础。

asyncio is often a perfect fit for IO-bound and high-level structured network code.通常非常适合IO绑定和高级结构化网络代码。

asyncio provides a set of high-level APIs to:提供一组高级API,用于:

Additionally, there are low-level APIs for library and framework developers to:此外,库和框架开发人员还可以使用低级API:

Reference参考

Note

The source code for asyncio can be found in Lib/asyncio/.asyncio的源代码可以在Lib/asyncio/中找到。