Sha256: f5fffe0fb9dbf5665b163f49272d1c89c669b0e700028515f7817464237d7cf4

Contents?: true

Size: 331 Bytes

Versions: 8

Compression:

Stored size: 331 Bytes

Contents

require File.expand_path('spec/spec_helper')

result = Parallel.map(1..100, :in_processes => 4) do |x|
  sleep 0.1 # so all processes get started
  print x
  raise Parallel::Break if x == 1
  sleep 0.1 # so no now work gets queued before Parallel::Break is raised
  x
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_processes_and_break.rb
parallel-0.8.2 spec/cases/map_with_processes_and_break.rb
parallel-0.8.1 spec/cases/map_with_processes_and_break.rb
parallel-0.8.0 spec/cases/map_with_processes_and_break.rb
parallel-0.7.1 spec/cases/map_with_processes_and_break.rb
parallel-0.7.0 spec/cases/map_with_processes_and_break.rb
parallel-0.6.5 spec/cases/map_with_processes_and_break.rb
parallel-0.6.4 spec/cases/map_with_processes_and_break.rb