Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created March 9, 2013 02:02
Show Gist options
  • Save hiredman/5122156 to your computer and use it in GitHub Desktop.
Save hiredman/5122156 to your computer and use it in GitHub Desktop.
parallel require
(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