- Hands-On Reactive Programming with Python
- Romain Picard
- 170字
- 2021-06-24 18:25:16
Introduction to AsyncIO
AsyncIO is the official asynchronous framework for Python. As explained in the previous section, this does not mean that it is the only one available. Twisted and Gevent are two other asynchronous frameworks that are very famous. However, since its release in Python 3.4, AsyncIO has become very popular rather quickly. There is no doubt that one reason for this success comes from the philosophy of Python: There should be only one obvious way to do something. Since AsyncIO is part of the standard library, it is the de facto way to do asynchronous programming in Python. Another reason is probably that it was released with the correct timing, when developers regained interest in asynchronous programming.
AsyncIO relies on three entities:
- Futures: They represent values that will be available later
- Coroutines: They allow you to execute asynchronous actions
- Event loops: They schedule the execution of the active tasks
These three entities are the classical ones in modern asynchronous programming. Let's look at each of them.
- Linux網(wǎng)絡(luò)管理與配置(第2版)
- Linux系統(tǒng)架構(gòu)與運(yùn)維實(shí)戰(zhàn)
- Ganglia系統(tǒng)監(jiān)控
- 循序漸進(jìn)學(xué)Docker
- Windows Phone應(yīng)用程序開(kāi)發(fā)
- Linux就該這么學(xué)
- Windows 7應(yīng)用入門與技巧
- 寫給架構(gòu)師的Linux實(shí)踐:設(shè)計(jì)并實(shí)現(xiàn)基于Linux的IT解決方案
- 鴻蒙操作系統(tǒng)設(shè)計(jì)原理與架構(gòu)
- Linux網(wǎng)絡(luò)操作系統(tǒng)項(xiàng)目教程(RHEL 7.4/CentOS 7.4)(第3版)(微課版)
- 應(yīng)急指揮信息系統(tǒng)設(shè)計(jì)
- OpenStack Essentials(Second Edition)
- 電腦辦公(Windows 7+Office 2016)入門與提高
- Website Development with PyroCMS
- Hadoop Operations and Cluster Management Cookbook