Python asyncio About This Book

貢獻者:deepfish 類別:英文 時間:2022-08-27 21:09:12 收藏數:8 評分:0
返回上页 舉報此文章
请选择举报理由:




收藏到我的文章 改錯字
Python Concurrency with asyncio was written to teach you how to utilize concurrency in
Python to improve application performance, throughput, and responsiveness. We
start by focusing on core concurrency topics, explaining how asyncio's model of single-
threaded concurrency works as well as how coroutines and async/await syntax works.
We then transition into practical applications of concurrency, such as making multiple
web requests or database queries concurrently, managing threads and processes,
building web applications, and handling synchronization issues.
Who should read this book?
This book is for intermediate to advanced developers who are looking to better
understand and utilize concurrency in their existing or new Python applications. One
of the goals of this book is to explain complex concurrency topics in plain, easy-to-
understand language. To that end, no prior experience with concurrency is needed,
though of course, it is helpful. In this book we'll cover a wide range of uses, from web-
based APIs to command-line applications, so this book should be applicable to many
problems you'll need to solve as a developer.How this book is organized: A road map
This book is organized into 14 chapters, covering gradually more advanced topics that
build on what you've learned in previous chapters.
Chapter 1 focuses on basic concurrency knowledge in Python. We learn what
CPU-bound and I/O-bound work is and introduce how asyncio's single-threaded
concurrency model works.
Chapter 2 focuses on the basics of asyncio coroutines and how to use async/
await syntax to build applications utilizing concurrency.
Chapter 3 focuses on how non-blocking sockets and selectors work and how to
build an echo server using asyncio.
Chapter 4 focuses on how to make multiple web requests concurrently. Doing
this, we'll learn more about the core asyncio APIs for running coroutines
concurrently.
Chapter 5 focuses on how to make multiple database queries concurrently
using connection pools. We'll also learn about asynchronous context managers
and asynchronous generators in the context of databases
Chapter 6 focuses on multiprocessing, specifically how to utilize it with asyncio
to handle CPU-intensive work. We'll build a map/reduce application to demon-
strate this.
Chapter 7 focuses on multithreading, specifically how to utilize it with asyncio
to handle blocking I/O. This is useful for libraries that don't have native
asyncio support but can still benefit from concurrency.
Chapter 8 focuses on network streams and protocols. We'll use this to create a
chat server and client capable of handling multiple users concurrently.
Chapter 9 focuses on asyncio-powered web applications and the ASGI (asyn-
chronous server gateway interface). We'll explore a few ASGI frameworks and
discuss how to build web APIs with them. We'll also explore WebSockets.
Chapter 10 describes how to use asyncio-based web APIs to build a hypothetical
microservice architecture.
Chapter 11 focuses on single-threaded concurrency synchronization issues and
how to resolve them. We dive into locks, semaphores, events, and conditions.
Chapter 12 focuses on asynchronous queues. We'll use these to build a web appli-
cation that responds to client requests instantly, despite doing time-consuming
work in the background.
Chapter 13 focuses on creating and managing subprocesses, showing you how
to read from and write data to them.
Chapter 14 focuses on advanced topics, such as forcing event loop iterations,
context variables, and creating your own event loop. This information will be
most useful to asyncio API designers and those interested in how the innards of
the asyncio event loop function.
At minimum, you should read the first four chapters to get a full understanding of
how asyncio works, how to build your first real application, and how to use the core
asyncio APIs to run coroutines concurrently (covered in chapter 4). After this you
should feel free to move around the book based on your interests.
声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。
文章熱度:
文章難度:
文章質量:
說明:系統根據文章的熱度、難度、質量自動認證,已認證的文章將參與打字排名!

本文打字排名TOP20

登录后可见