(with-exponential-backoff slot-time-ms max-attempts catch-fn & body)
Tries to run body
for max-attempts
. Uses an exponential backoff algorithm, meaning
that, for every attempt, it will wait K * slot-time-ms
, where K is 2^c - 1
, c
being the attempt index.
Tries to run `body` for `max-attempts`. Uses an exponential backoff algorithm, meaning that, for every attempt, it will wait K * `slot-time-ms`, where K is `2^c - 1`, `c` being the attempt index.
(with-simple-sleep sleep-ms max-attempts catch-fn & body)
Tries to run body
for max-attempts
. Between each attempt it will sleep for
sleep-ms
seconds.
Tries to run `body` for `max-attempts`. Between each attempt it will sleep for `sleep-ms` seconds.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close