Skip to content

Instantly share code, notes, and snippets.

@halgari
Created August 29, 2013 19:33
Show Gist options
  • Save halgari/6382422 to your computer and use it in GitHub Desktop.
Save halgari/6382422 to your computer and use it in GitHub Desktop.
(def c (chan))
(defn drain [c]
(go
(loop [col []]
(if-let [v (<! c)]
(recur (conj col v))
col))))
(go
(let [s (<! (drain c))]
...do something...))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment