parallel 1.15.0 → 1.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bb218d88e86c80e67ccbfd2d30e364fd23090d3ec0217aa8f7bab38cede2763
4
- data.tar.gz: 5b0892050ecdb41322b9291398631a65439ce0edcf513ed46e4f49291407dafd
3
+ metadata.gz: bedc98448e417d72b0c170df7c9dcfa3fd64335322ff3edd99ed150cec2f9522
4
+ data.tar.gz: edaed373b40aea133d0d636d8ada412bf9098f348848c8db425f5cec5f041fc4
5
5
  SHA512:
6
- metadata.gz: 8cf31feef7f7556ebe43330e4beb1ef6370ec0d5392c312ed39abb59113ba7bd5878aa8d7c53ee002c2da61dabadb0cebce9bca12dea20094e7ed2297b96b054
7
- data.tar.gz: 74781cc0d3f20acef7f437abc2f2ea5183f9c8f9e6f8dfd6399ba60dc5cf0f7828b3bfdc48028f143920d0e8bdc1777c83aaf965ac5557b562aace6e54c44473
6
+ metadata.gz: 06b5637f0b775d651c0e9f9621a6537b8aab6cd162122e8fb6c9ce20b9628ae5bae81b2026a60622d6471f357aa11db5599b08ba69922e38eabfbb0e12d6a402
7
+ data.tar.gz: 2a0d3683170330b7c7314f00ab55161f3c8902d13a0f9b9a1ee3968c55b7ba30a0d48d8bd513e76825f54419ac47024d8193534bf0f8ec01b5db80d7c9c31c4e
@@ -22,7 +22,7 @@ module Parallel
22
22
  end
23
23
  end
24
24
 
25
- Stop = Object.new
25
+ Stop = Object.new.freeze
26
26
 
27
27
  class ExceptionWrapper
28
28
  attr_reader :exception
@@ -202,9 +202,12 @@ module Parallel
202
202
  class << self
203
203
  def in_threads(options={:count => 2})
204
204
  count, _ = extract_count_from_options(options)
205
- Array.new(count) do |i|
205
+ threads = Array.new(count) do |i|
206
206
  Thread.new { yield(i) }
207
- end.map!(&:value)
207
+ end
208
+ threads.map(&:value)
209
+ ensure
210
+ threads.each(&:kill)
208
211
  end
209
212
 
210
213
  def in_processes(options = {}, &block)
@@ -462,7 +465,11 @@ module Parallel
462
465
  rescue
463
466
  ExceptionWrapper.new($!)
464
467
  end
465
- Marshal.dump(result, write)
468
+ begin
469
+ Marshal.dump(result, write)
470
+ rescue Errno::EPIPE
471
+ return # parent thread already dead
472
+ end
466
473
  end
467
474
  end
468
475
 
@@ -1,3 +1,3 @@
1
1
  module Parallel
2
- VERSION = Version = '1.15.0'
2
+ VERSION = Version = '1.16.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parallel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.15.0
4
+ version: 1.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-24 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: michael@grosser.it