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 +4 -4
- data/lib/parallel.rb +11 -4
- data/lib/parallel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bedc98448e417d72b0c170df7c9dcfa3fd64335322ff3edd99ed150cec2f9522
|
4
|
+
data.tar.gz: edaed373b40aea133d0d636d8ada412bf9098f348848c8db425f5cec5f041fc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06b5637f0b775d651c0e9f9621a6537b8aab6cd162122e8fb6c9ce20b9628ae5bae81b2026a60622d6471f357aa11db5599b08ba69922e38eabfbb0e12d6a402
|
7
|
+
data.tar.gz: 2a0d3683170330b7c7314f00ab55161f3c8902d13a0f9b9a1ee3968c55b7ba30a0d48d8bd513e76825f54419ac47024d8193534bf0f8ec01b5db80d7c9c31c4e
|
data/lib/parallel.rb
CHANGED
@@ -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
|
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
|
-
|
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
|
|
data/lib/parallel/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: michael@grosser.it
|