Skip to main content

Module backoff

Module backoff 

Source
Expand description

统一指数退避(全 workspace 唯一实现)

供 Supervisor 重启退避、Proxy 熔断器恢复退避等场景复用:

全部 saturating 算术,禁止溢出回绕。

Functions§

exponential_backoff
计算指数退避(毫秒):base * multiplier^exponent,封顶 cap
exponential_backoff_with_jitter
计算带全抖动的指数退避(毫秒):[0, exponential_backoff] 均匀随机