Created
March 9, 2013 02:02
-
-
Save hiredman/5122156 to your computer and use it in GitHub Desktop.
parallel require
This file contains hidden or 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
(alter-var-root #'require | |
(fn [o-require] | |
(fn [& args] | |
(let [{opts true nses false} (group-by keyword? args)] | |
(doall | |
(map #(.join %) | |
(doall | |
(for [ns nses] | |
(doto (Thread. #(apply o-require ns opts)) | |
.start))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment