Open leonoel opened 11 months ago
From adamfrey on slack :
adamfrey
(do ;; keeping track of how many times the fl flow runs (def *run-count (atom 0)) (def fl (m/ap (let [i (m/?> (m/seed (range 10)))] (swap! *run-count inc) i))) ;; creating a publisher for multiple subscribers (def fl-stream (m/stream fl)) (defn my-rf ([] []) ([acc] acc) ([acc x] (println "rf" x) (conj acc x))) (def joined (m/join vector (m/reduce my-rf (m/eduction (map #(* % 10)) fl-stream)) (m/reduce my-rf (m/eduction (map #(* % 100)) fl-stream)))) ;; (m/? joined) hangs forever (joined prn prn) ;; only reduces the first eduction ;; question: am I incorrectly initializing multiple subscribers to my stream? @*run-count )
Notes :
m/memo
m/join
Why does it need memo?
From
adamfrey
on slack :Notes :
m/memo
afterm/join
, the pattern is not obvious and should be documented.