February 2019
Intermediate to advanced
672 pages
16h 50m
English
With the general structure of an asynchronous program in mind, let's consider the specific APIs that the asyncio module and Python provide for the implementation of asynchronous programs. The first foundation for this API is the async and await keywords that were added to Python 3.5. These keywords are used to specify the main elements of an asynchronous program to Python.
Specifically, async is typically put in front of the def keyword when a function is declared. A function with the async keyword in front of it will be interpreted by Python as a coroutine. As we discussed, inside of each coroutine, there has to be a specification regarding when the task switching events will take place. The await keyword is then used to specify ...