知识卡片
积压需要背压策略
背压是让上游感知下游容量的机制。队列持续变长说明速率不匹配,实践需选择阻塞或限速生产者、明确拒绝、合并最新值,或通知订阅者发生跳失。单纯增加缓冲只能延迟容量耗尽。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 6. Reactive Programming 消费速率、背压和批量清理 · 查看原书依据
The rate of creation of events can sometimes be bigger than the rate at which events can be processed. This results in a buildup of events, which is called backpressure. Backpressure can be solved by a range of approaches beyond the scope of this book. Concepts such as buffering, flow control, rate limiting, batch processing, and load balancing can help reduce backpressure when it builds
参考来源
- 位置:《Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)》第06章《Chapter 6. Reactive Programming》,消费速率、背压和批量清理(来源项目 book-source,extracted/Async Rust Unleashing the Power of Fearless Concurrency (Maxwell Flitton, Caroline Morton)/_epub-src/OEBPS/ch06.html#interactingEventBus)
- 结论依据:原书指出生产率超过处理率会积压,并列出限速、批处理和流量控制。
- 原始内容:The rate of creation of events can sometimes be bigger than the rate at which events can be processed. This results in a buildup of events, which is called backpressure. Backpressure can be solved by a range of approaches beyond the scope of this book. Concepts such as buffering, flow control, rate limiting, batch processing, and load balancing can help reduce backpressure when it builds