Try a function, with square backoff. Uses a threadpool, so can run lots of concurrent things at once.
Try a function, with square backoff. Uses a threadpool, so can run lots of concurrent things at once.
(get-pool-size)
(try-backoff f sleep-ms max-attempts error-f terminate-f finally-f)
Try a function. If it throws an exception, back off. The exception is passed to error-f. If it returns true, keep trying. If errors continue to max-attempts, call terminate-f. Finally-f is called on finish, on success or failure.
Back-off starts with sleep-ms milliseconds and doubles each time.
Try a function. If it throws an exception, back off. The exception is passed to error-f. If it returns true, keep trying. If errors continue to max-attempts, call terminate-f. Finally-f is called on finish, on success or failure. Back-off starts with sleep-ms milliseconds and doubles each time.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close