Asyncio Recipes: A Problem-Solution Approach
暫譯: Asyncio 食譜:問題解決方法

Tahrioui, Mohamed Mustapha

  • 出版商: Apress
  • 出版日期: 2019-05-22
  • 售價: $1,250
  • 貴賓價: 9.5$1,188
  • 語言: 英文
  • 頁數: 313
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1484244001
  • ISBN-13: 9781484244005
  • 相關分類: Python
  • 立即出貨 (庫存=1)

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

商品描述

Get the most out of asyncio and find solutions to your most troubling Python programming problems. This book offers a pragmatic collection of recipes by going beyond online resources and docs to provide guidance on using this complex library. As such, you'll see how to improve application performance and run computationally intensive programs faster.
asyncio Recipes starts with examples illustrating the primitives that come with the asyncio library, and explains how to determine if asyncio is the right choice for your application. It shows how to use asyncio to yield performance gains without multiple threads, and identifies common mistakes and how to prevent them. Later chapters cover error-handling, testing, and debugging. By the end of this book, you'll understand how asyncio runs behind the scenes, and be confident enough to contribute to asyncio-first projects.
What You Will Learn

  • Discover quirky APIs such as the event loop policies
  • Write asyncio code with native coroutines
  • Use the ast module to find legacy asyncio code
  • Work with contextvars
  • See what a async context manager is and why a lot of asyncio APIs use them


Who This Book Is For
Experienced Python developers or hobbyists who want to understand asyncio and speed up their applications by adding concurrency to their toolkit.

商品描述(中文翻譯)

充分利用 asyncio,解決您最棘手的 Python 程式設計問題。本書提供了一系列實用的範例,超越線上資源和文檔,為使用這個複雜庫提供指導。因此,您將學會如何改善應用程式性能,並更快地運行計算密集型程序。

asyncio Recipes 以示範 asyncio 庫中提供的基本元素的範例開始,並解釋如何判斷 asyncio 是否適合您的應用程式。它展示了如何在不使用多線程的情況下,利用 asyncio 獲得性能提升,並指出常見錯誤及其預防方法。後面的章節涵蓋錯誤處理、測試和除錯。到本書結束時,您將了解 asyncio 在背後的運作方式,並有信心為以 asyncio 為主的專案做出貢獻。

您將學到什麼


  • 發現奇特的 API,例如事件循環策略

  • 使用原生協程編寫 asyncio 代碼

  • 使用 ast 模組查找舊版 asyncio 代碼

  • 使用 contextvars

  • 了解什麼是 async 上下文管理器,以及為什麼許多 asyncio API 使用它們



本書適合誰閱讀

有經驗的 Python 開發者或愛好者,想要理解 asyncio 並通過將並發性添加到他們的工具包中來加速應用程式。

作者簡介

Mohamed T. is a developer of 7 years and an enthusiastic Pythonista.Using asyncio since it's advent in the 3.4 Python version as the backbone of the Smartspeaker project of the Deutsche Telekom he is well suited to show how to use asyncio in a production setting.When he is not hacking on asyncio (or bugging Yuri with his asyncio questions) he prefers to familiarise himself with the Yocto build system or read kernel changelogs.

作者簡介(中文翻譯)

Mohamed T. 是一位擁有 7 年經驗的開發者,也是熱情的 Pythonista。自從 Python 3.4 版本推出 asyncio 以來,他便將其作為德國電信 Smartspeaker 專案的核心,十分適合展示如何在生產環境中使用 asyncio。當他不在研究 asyncio(或向 Yuri 詢問 asyncio 的問題)時,他喜歡熟悉 Yocto 建置系統或閱讀內核變更日誌。

最後瀏覽商品 (20)