def retry.jitter

bend-kit-http@0.38.2.0 · http.bend:4554

import bend-kit-http@0.38.2.0/http.bend as Http
import Base

4554# ponytail: a failed random source gives jitter 0, so the wait is the lower half.
4555def retry.jitter(r: Result<&1, &1, U32 & String, U32>) -> U32:
4556  match r:
4557    case Fail{e}:
4558      0
4559    case Done{x}:
4560      x

Uses (4)

Used by (2)