相關主題
商品描述
Already popular among programmers for its memory safety and speed, the Rust programming language is also valuable for asynchrony. This practical book shows you how asynchronous Rust can help you solve problems that require multitasking. You'll learn how to apply async programming to solve problems with an async approach. You will also dive deeper into async runtimes, implementing your own ways in which async runtimes handle incoming tasks.
Authors Maxwell Flitton and Caroline Morton also show you how to implement the Tokio software library to help you with incoming traffic, communicate between threads with shared memory and channels, and design a range of complex solutions using actors. You'll also learn to perform unit and end-to-end tests on a Rust async system.
With this book, you'll learn:
- How Rust approaches async programming
- How coroutines relate to async Rust
- Reactive programming and how to implement pub sub in async rust
- How to solve problems using actors
- How to customize Tokio to gain control over how tasks are processed
- Async Rust design patterns
- How to build an async TCP server just using the standard library
- How to unit test async Rust
By the end of the book, you'll be able to implement your own async TCP server completely from the standard library with zero external dependencies, and unit test your async code.
商品描述(中文翻譯)
已經在程式設計師中因其記憶體安全性和速度而受到歡迎的 Rust 程式語言,對於非同步處理也具有重要價值。本書實用地展示了非同步 Rust 如何幫助您解決需要多任務處理的問題。您將學習如何應用非同步程式設計來解決問題,並深入了解非同步執行環境,實作您自己的方式來處理進來的任務。
作者 Maxwell Flitton 和 Caroline Morton 也將向您展示如何實作 Tokio 軟體庫,以協助您處理進來的流量,透過共享記憶體和通道在執行緒之間進行通信,並使用演員設計一系列複雜的解決方案。您還將學習如何對 Rust 的非同步系統進行單元測試和端對端測試。
透過本書,您將學習到:
- Rust 如何處理非同步程式設計
- 協程與非同步 Rust 的關係
- 反應式程式設計及如何在非同步 Rust 中實作發布/訂閱模式
- 如何使用演員解決問題
- 如何自訂 Tokio 以控制任務的處理方式
- 非同步 Rust 設計模式
- 如何僅使用標準庫構建非同步 TCP 伺服器
- 如何對非同步 Rust 進行單元測試
在本書結束時,您將能夠完全從標準庫實作自己的非同步 TCP 伺服器,並且沒有任何外部依賴,並對您的非同步程式碼進行單元測試。