Created
November 28, 2014 00:38
-
-
Save ciniglio/4b0636aed59087323d3f to your computer and use it in GitHub Desktop.
Unordered pipeline
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
(def from-chan) | |
(def to-chan) | |
(dotimes [_ num-threads] | |
(let [rf (fn [_ x] (>!! to-chan)) | |
f (xform rf)] | |
(thread | |
(loop [] | |
(when-some [x (<!! from-chan)] | |
(f x)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment