Fork me on GitHub
#aleph
<
2019-10-04
>
pbaille08:10:00

Hello! question: how can I achieve this with manifold?

(async/go-loop []
  (async/<! (async/timeout 1000))
  (println "tic")
  (recur))

valerauko08:10:00

deferred/loop and deferred/let-flow should work i think

pbaille08:10:34

in my little experience deferred/loop blocks

pbaille08:10:42

I must missing something 🙂

pbaille08:10:16

is there an analog manifold construct for async/timeout?

valerauko08:10:56

there's deferred/timeout

valerauko08:10:27

manifold.stream/consume might be similar too

pbaille08:10:58

@vale thank you for your help 🙂

mccraigmccraig09:10:18

@pbaille cheesy, but

(defn tics [n] (d/chain (d/timeout! (d/deferred) n ::timeout) (fn [_] (prn "tic") (tics n))))

pbaille09:10:54

🙂 thank you!