Skip to content

Instantly share code, notes, and snippets.

View jstewart's full-sized avatar

Jason Stewart jstewart

View GitHub Profile
(defn unordered-pmap [threads f in-c out-c]
(let [remain (atom threads)]
(dotimes [x threads]
(go-loop []
(if-some [v (<! in-c)]
(do (>! out-c (f v))
(recur))