backpressure - Serbipunk/notes GitHub Wiki

https://mp.weixin.qq.com/s?src=11&timestamp=1583208057&ver=2193&signature=theQn5NA2UjJZgOJK50OqGDWmtd5JE8AEg0-CmtCr22D06IPslTqXTscpEX5QLOVLgDIN-tYiL9ecPO-uOm0yCgtGa*81FlDa2bmudOLkvas9HOiB2pYFYrS2IUcLBZw&new=1

Backpressure is when the progress of turning that input to output is resisted in some way. In most cases that resistance is computational speed — trouble computing the output as fast as the input comes in — so that’s by far the easiest way to look at it. But other forms of backpressure can happen too: for example, if your software has to wait for the user to take some action.

通常处理这种状态的策略有以下三种:

  • Buffer:将输入暂时保存下来

  • Drop:丢弃掉输入

  • Control:由消费者来控制生产者的速度