官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 新宁县| 西峡县| 木兰县| 东兰县| 宜阳县| 顺昌县| 前郭尔| 城市| 宣恩县| 哈尔滨市| 托克逊县| 邢台市| 龙胜| 肥西县| 江川县| 南宫市| 崇义县| 中宁县| 曲水县| 南丰县| 连平县| 铜川市| 曲阜市| 凤凰县| 鹤庆县| 城固县| 观塘区| 道孚县| 克拉玛依市| 石门县| 岳阳市| 洪江市| 禹城市| 虞城县| 惠来县| 吉木萨尔县| 新竹县| 台东县| 咸阳市| 安陆市| 沙湾县|