Skip to content

Instantly share code, notes, and snippets.

@guv
Created November 17, 2014 16:54
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 guv/d91b39ea19c47bc8afed to your computer and use it in GitHub Desktop.
Save guv/d91b39ea19c47bc8afed to your computer and use it in GitHub Desktop.
Parallel testing with synchronous start
(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