Just a quick demo of how the Clojure core.async merge function works. I wanted to check that the values from the input channels appear in the merged channel straight away.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|(let [sleepy-val (fn [v t] (clojure.core.async/go|
|(clojure.core.async/<! (clojure.core.async/timeout t))|
|chans (clojure.core.async/merge (map #(sleepy-val % (rand-int 3000))|
|(while (when-let [v (clojure.core.async/<! chans)]|