Fork me on GitHub
#aleph
<
2020-02-03
>
cddr13:02:01

@vincentjames501 I think if you make the try-take! part of the loop argument, then when you recur you can recur with another call to try-take! which should slow it down.

(d/loop [msg (s/try-take! s nil 100 ::timeout)]
  (d/chain msg
    (fn [msg]
      (if (= ::timeout msg)
         (do (backoff-a-bit)
             (d/recur (s/try-take! s nil 100 ::timeout)))
         (d/recur (s/try-take! s nil 100 ::timeout))))))