Skip to content

Instantly share code, notes, and snippets.

@ifesdjeen
Created June 21, 2015 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ifesdjeen/df779350e6f433db90fc to your computer and use it in GitHub Desktop.
Save ifesdjeen/df779350e6f433db90fc to your computer and use it in GitHub Desktop.
(let [channel (create)
incremented-values (map* inc channel)
decremented-values (map* dec channel)]
(consume incremented-values (fn [i] (println "Incremented value: " i)))
(consume decremented-values (fn [i] (println "Decremented value: " i)))
(accept channel 1)
(accept channel 2)
(accept channel 3)
(ms/flush channel))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment