Skip to content

Instantly share code, notes, and snippets.

@gszeliga
Created December 6, 2017 15:44
Show Gist options
  • Save gszeliga/7228287b4812d9e573228fa12912888b to your computer and use it in GitHub Desktop.
Save gszeliga/7228287b4812d9e573228fa12912888b to your computer and use it in GitHub Desktop.
(defn process! [path fname npar]
(let [lines (mult (stream-lines-from path))
aggregate-tap (tap lines (chan 1024))
count-tap (tap lines (chan 1024))]
(<!! (async/reduce
(fn [_ v] (println v))
""
(async/merge [(aggregate-field fname aggregate-tap npar)
(count-lines count-tap npar)])))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment