                                    {:status :success})
                          lock-ms        (* 60 60 1000)
                          throttle-ms    200
-                         eoq-backoff-ms 2000
-                         lock-ms (* 60 60 1000)
-                         auto-start? true}}]]
-  (let [w (Worker. conn qname (atom false) {:handler        handler
-                                            :lock-ms        lock-ms
-                                            :throttle-ms    throttle-ms
-                                            :eoq-backoff-ms eoq-backoff-ms
-                                            :auto-start?    auto-start?})]
-    (when auto-start? (start w))
-    w))
+                         eoq-backoff-ms (fn [dry-runs] (exp-backoff dry-runs
+                                                        {:max 10000}))
+                         auto-start?    true}}]]
+  (let [w (Worker. conn qname (atom false) (atom 0)
+                   {:handler        handler
+                    :lock-ms        lock-ms
+                    :throttle-ms    throttle-ms
+                    :eoq-backoff-ms eoq-backoff-ms})]
+    (when auto-start? (start w)) w))
 
 (comment
   (def w1 (worker {} "myq"))
   (wcar {} (enqueue "myq" "msg"))
   (stop w1)
   (queue-status {} "myq"))
-
-;;;; Public utils
-
-(defn exp-backoff "Exponential backoff msecs. Useful for retries."
-  [attempt & [{:keys [factor min max]
-               :or   {factor 2000}}]]
-  (let [binary-exp (Math/pow 2 (dec attempt))
-        time (* (+ binary-exp (rand binary-exp)) 0.5 factor)]
-    (long (let [time (if min (clojure.core/max min time) time)
-                time (if max (clojure.core/min max time) time)]
-            time))))
-
-(comment (map #(exp-backoff % {}) (range 10)))
 
 ;;;; Renamed/deprecated
 

  (:require [clojure.string   :as str]
            [taoensso.carmine :as car :refer (wcar)]
            [taoensso.timbre  :as timbre]))

;;;; Implementation


                     considered fatally stalled and message re-queued. Must be
                     sufficiently high to prevent double handling.
   :eoq-backoff-ms - Thread sleep period each time end of queue is reached.
                     Can be a (fn [dry-run-count]) => ms. Sleep synchronized
                     between all queue workers.
   :throttle-ms    - Thread sleep period between each poll."
  [conn qname & [{:keys [handler lock-ms eoq-backoff-ms throttle-ms auto-start?]
                  :or   {handler (fn [{:keys [message attempt]}]
