Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created January 8, 2013 23:08
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 hiredman/4488907 to your computer and use it in GitHub Desktop.
Save hiredman/4488907 to your computer and use it in GitHub Desktop.
pmap
(defn pmap [executor step-size fun s]
(concat (for [f (doall (for [e (take step-size s)]
(.submit executor (partial fun s))))]
(.get f))
(lazy-seq
(pmap executor step-size fun (drop step-size s)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment