-
-
Save tomjack/7108adefc34f7ff2ea73 to your computer and use it in GitHub Desktop.
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
(defn mix-promise [& functions] | |
(fn [& args] | |
(let [result (promise) | |
futures (doall (for [fun functions] | |
(future (deliver result (apply fun args))))) | |
answer @result] | |
(dorun (map future-cancel futures)) | |
answer))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment