(exponential-backoff {:as opts
:keys [get-delays-ms imprecision-ms]
:or {get-delays-ms (constantly [1000 2000 4000 8000
16000])
imprecision-ms 1000}}
af)
Implements exponential backoff.
Returns a channel which will receive either the completed result or an error.
Implements exponential backoff. * af is a function which accepts 3 channels (af =success= =error= =retry=), and should do exactly one of the following operations without blocking: - put a successful value in =success= - put an error in =error= (will break the loop) - put an error which causes a retry in =retry=. * the exponential backoff loop can be configured with :get-delay-ms, a function which returns a (potentially infinite) seq of backoff intervals, and :imprecision-ms, a maximum number of milliseconds with which to randomly blurr the backoff intervals. Returns a channel which will receive either the completed result or an error.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close