Created
November 17, 2014 16:54
-
-
Save guv/d91b39ea19c47bc8afed to your computer and use it in GitHub Desktop.
Parallel testing with synchronous start
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
(let [signal (promise), | |
; create waiting threads | |
future-coll (vec | |
(for [some-val some-coll] | |
(future | |
(deref signal) | |
(do-something some-val))))] | |
; signal start to all threads | |
(deliver signal true) | |
; wait for all threads to finish | |
(mapv deref future-coll)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment