def retry.jitter

bend-kit-http@0.38.5.0 · http.bend:4558

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

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

Uses (4)

Used by (2)