Using Asyncio in Python: Understanding Python's Asynchronous Programming Features
暫譯: 在 Python 中使用 Asyncio:理解 Python 的非同步程式設計特性

Hattingh, Caleb

買這商品的人也買了...

商品描述

If you're among the Python developers put off by Asyncio's complexity, it's time to take another look. Asyncio is complicated because it aims to solve problems in concurrent network programming for both framework developers and end-user developers like you. The features you need to consider are a small subset of the whole Asyncio API, but picking out the right features is the tricky part. That's where this practical book comes in.

Veteran Python developer Caleb Hattingh helps end-user developers gain a basic understanding of Asyncio's building blocks--enough to get you started writing simple event-based programs. You'll learn why Asyncio offers a safer alternative to preemptive multitasking (threading) and how this API provides a simple way to support thousands of simultaneous socket connections.

  • Get a critical comparison of Asyncio and threading for concurrent network programming
  • Take an Asyncio walkthrough, including a quickstart guide to help you hit the ground looping with event-based programming
  • Learn the difference between Asyncio features for end-user developers and those for framework developers
  • Understand Asyncio's new async/await language syntax, including coroutines and task and future APIs
  • Get detailed case studies (with code) of some popular Asyncio-compatible third-party libraries

商品描述(中文翻譯)

如果您是因為 Asyncio 的複雜性而感到困擾的 Python 開發者,那麼現在是時候重新檢視它了。Asyncio 之所以複雜,是因為它旨在解決框架開發者和像您這樣的最終用戶開發者在並發網路編程中所面臨的問題。您需要考慮的功能只是整個 Asyncio API 的一小部分,但挑選出正確的功能卻是棘手的部分。這就是這本實用書籍的用武之地。

資深 Python 開發者 Caleb Hattingh 幫助最終用戶開發者獲得對 Asyncio 基本組件的理解——足以讓您開始編寫簡單的基於事件的程式。您將學習為什麼 Asyncio 提供了一種比搶佔式多工(threading)更安全的替代方案,以及這個 API 如何提供一種簡單的方法來支持數千個同時的套接字連接。

- 獲得 Asyncio 和 threading 在並發網路編程中的關鍵比較
- 進行 Asyncio 的逐步指導,包括快速入門指南,幫助您快速開始基於事件的編程
- 了解 Asyncio 功能對最終用戶開發者和框架開發者的區別
- 理解 Asyncio 的新 async/await 語言語法,包括協程和任務及未來 API
- 獲得一些流行的 Asyncio 兼容第三方庫的詳細案例研究(附代碼)

作者簡介

Caleb Hattingh is passionate about coding and has been programming for over 20 years, specializing in Python. He holds a master's degree in chemical engineering and has consequently written a great deal of scientific software within chemical engineering, from dynamic chemical reactor models all the way through to data analysis. He is very experienced with the Python scientific software stack, as well as CRM, financial software development in the hospitality industry, GPS tracking, natural-language processing, and various other projects.

作者簡介(中文翻譯)

Caleb Hattingh 對程式設計充滿熱情,並且已經編程超過 20 年,專精於 Python。他擁有化學工程碩士學位,因此在化學工程領域撰寫了大量科學軟體,從動態化學反應器模型到數據分析。他對 Python 科學軟體堆疊非常熟悉,並且在客戶關係管理(CRM)、酒店業的金融軟體開發、GPS 追蹤、自然語言處理以及其他各種專案方面也有豐富的經驗。