Sha256: 1f113dcca176308735b638db9b0d876c58527094327400b2f2b63ed092ca9037

Contents?: true

Size: 323 Bytes

Versions: 8

Compression:

Stored size: 323 Bytes

Contents

require File.expand_path('spec/spec_helper')

result = Parallel.map(1..100, :in_threads => 4) do |x|
  sleep 0.1 # so all threads get started
  print x
  raise Parallel::Break if x == 1
  sleep 0.1 # so no now work gets queued before Parallel::Break is raised
end
print " Parallel::Break raised - result #{result.inspect}"

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
parallel-0.8.3 spec/cases/map_with_threads_and_break.rb
parallel-0.8.2 spec/cases/map_with_threads_and_break.rb
parallel-0.8.1 spec/cases/map_with_threads_and_break.rb
parallel-0.8.0 spec/cases/map_with_threads_and_break.rb
parallel-0.7.1 spec/cases/map_with_threads_and_break.rb
parallel-0.7.0 spec/cases/map_with_threads_and_break.rb
parallel-0.6.5 spec/cases/map_with_threads_and_break.rb
parallel-0.6.4 spec/cases/map_with_threads_and_break.rb