知识卡片
异步流水线保留依赖
流水线每阶段建立清晰的输入、输出与失败契约。顺序 await 与数据依赖相符,独立分支才有机会并发。如果早期阶段已产生副作用,? 只负责错误传播,补偿与结果持久化还需要另订规则。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 9. Design Patterns 数据依赖串成流水线 · 查看原书依据
The waterfall approach is simple and predictable. It also enables us to reuse our async tasks for building blocks. For instance, our three async tasks could be accepting i32 data types. We could add logic around these async tasks as follows:
参考来源
- 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第09章《Chapter 9. Design Patterns》,数据依赖串成流水线(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch09.html#id58)
- 结论依据:三段任务用前一步输出作为输入,配合 Result 传播错误。
- 原始内容:The waterfall approach is simple and predictable. It also enables us to reuse our async tasks for building blocks. For instance, our three async tasks could be accepting i32 data types. We could add logic around these async tasks as follows: