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

Summary

This chapter covered all the base concepts of asynchronous programming and how they work in Python. You should now understand what it means to yield or await a coroutine and know the differences between blocking and non-blocking designs. Hopefully, the short history of asynchronous programming in Python and the examples of asynchronous programming with callback also helped you understand why Python is one of the few languages with best-in-class support of asynchronous programming.

Moreover, you should also be familiar enough with the AsyncIO APIs to write your own asynchronous applications. This chapter only covered the basic usage of AsyncIO, but the features presented here are the most-used ones. Other more advanced features will be introduced in this book, as they are needed in other examples.

One last word on this chapter: Do not be fooled by the simplicity of the echo server implementation. As simple as it is, it is nevertheless a solid foundation to implement real microservices in Python in a fully asynchronous way. A bigger project would require more code, but it would be based on the same APIs that are already used in this small project: the creation of an application, the routing of requests, eventually with variable resources, and the implementation of handlers.

The next chapter continues this introduction of asynchronous and reactive programming with a way to structure your code. More specifically, it will show you how functional programming is well adapted for the implementation of asynchronous code with ReactiveX.

主站蜘蛛池模板: 武平县| 台前县| 井冈山市| 鄂托克前旗| 衡阳市| 安仁县| 铜山县| 巴彦淖尔市| 馆陶县| 盐山县| 化州市| 调兵山市| 南汇区| 文水县| 台江县| 石林| 博野县| 青州市| 太白县| 北川| 曲周县| 桂东县| 西乌珠穆沁旗| 姜堰市| 湖南省| 通化县| 扎兰屯市| 祁门县| 民权县| 舟曲县| 定州市| 景泰县| 太白县| 日喀则市| 外汇| 随州市| 成安县| 富锦市| 黎川县| 湖南省| 罗源县|