Method: Minitest::ParallelEach#each
- Defined in:
- lib/minitest/parallel_each.rb
#each ⇒ Object
Starts N threads that yield each element to your block. Joins the threads at the end.
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/minitest/parallel_each.rb', line 36 def each threads = N.times.map { Thread.new do Thread.current.abort_on_exception = true while job = @queue.pop yield job end end } threads.map(&:join) end |