Skip to content

Instantly share code, notes, and snippets.

@devn

devn/foo.clj Secret

Created April 28, 2014 21:15
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 devn/72d8d9ad414ef448ced3 to your computer and use it in GitHub Desktop.
Save devn/72d8d9ad414ef448ced3 to your computer and use it in GitHub Desktop.
;; Add items to a pipeline
(go (doseq [row rows]
(>!! in row)))
;; When we've fully exhausted the out channel, exit.
(let [stop (chan)]
(go (loop []
(let [[v c] ($/alts! [out stop]
:default :continue)]
(if (= c stop)
(do (println "STOP!")
(System/exit 0))
(recur))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment