concurrent_executor 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +35 -34
- data/lib/concurrent_executor.rb +9 -1
- data/lib/concurrent_executor/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccdf00556bc04acd3d2d50890ba33812e28a2f06d9a84cd02d759c6db463d75c
|
4
|
+
data.tar.gz: e1bb12b8f6690eebfad033cf119ea1c5affbecdd78ba04f54323779c12012b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 117093f4daced145690f008ecb0fdeb0423f2911bd31c8a685be57942a9ed3fcca12977c2f508a7d6699cb54058dce81b535f488e707ed483417f4fbc2b05c3f
|
7
|
+
data.tar.gz: 4121850b3c066d4e5b7b05525e681148f3e57fb95a594eb3dc0d986055b86610e423848ef241f894316584970ce9ae4a58386e25b6594ceed20e29e45ffefd0c
|
data/Gemfile.lock
CHANGED
@@ -6,54 +6,55 @@ PATH
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
codecov (0.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
diff-lcs (1.3)
|
16
|
-
docile (1.3.2)
|
17
|
-
jaro_winkler (1.5.4)
|
18
|
-
json (2.3.0)
|
9
|
+
ast (2.4.2)
|
10
|
+
codecov (0.4.0)
|
11
|
+
simplecov (>= 0.15, < 0.22)
|
12
|
+
coderay (1.1.3)
|
13
|
+
diff-lcs (1.4.4)
|
14
|
+
docile (1.3.5)
|
19
15
|
method_source (1.0.0)
|
20
|
-
parallel (1.
|
21
|
-
parser (
|
22
|
-
ast (~> 2.4.
|
23
|
-
pry (0.13.
|
16
|
+
parallel (1.20.1)
|
17
|
+
parser (3.0.0.0)
|
18
|
+
ast (~> 2.4.1)
|
19
|
+
pry (0.13.1)
|
24
20
|
coderay (~> 1.1)
|
25
21
|
method_source (~> 1.0)
|
26
22
|
rainbow (3.0.0)
|
27
23
|
rake (12.3.3)
|
24
|
+
regexp_parser (2.0.3)
|
28
25
|
rexml (3.2.4)
|
29
|
-
rspec (3.
|
30
|
-
rspec-core (~> 3.
|
31
|
-
rspec-expectations (~> 3.
|
32
|
-
rspec-mocks (~> 3.
|
33
|
-
rspec-core (3.
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-expectations (3.
|
26
|
+
rspec (3.10.0)
|
27
|
+
rspec-core (~> 3.10.0)
|
28
|
+
rspec-expectations (~> 3.10.0)
|
29
|
+
rspec-mocks (~> 3.10.0)
|
30
|
+
rspec-core (3.10.1)
|
31
|
+
rspec-support (~> 3.10.0)
|
32
|
+
rspec-expectations (3.10.1)
|
36
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
34
|
+
rspec-support (~> 3.10.0)
|
35
|
+
rspec-mocks (3.10.1)
|
39
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
42
|
-
rubocop (
|
43
|
-
jaro_winkler (~> 1.5.1)
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-support (3.10.1)
|
39
|
+
rubocop (1.8.1)
|
44
40
|
parallel (~> 1.10)
|
45
|
-
parser (>=
|
41
|
+
parser (>= 3.0.0.0)
|
46
42
|
rainbow (>= 2.2.2, < 4.0)
|
43
|
+
regexp_parser (>= 1.8, < 3.0)
|
47
44
|
rexml
|
45
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
48
46
|
ruby-progressbar (~> 1.7)
|
49
|
-
unicode-display_width (>= 1.4.0, <
|
50
|
-
|
51
|
-
|
47
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
48
|
+
rubocop-ast (1.4.1)
|
49
|
+
parser (>= 2.7.1.5)
|
50
|
+
ruby-progressbar (1.11.0)
|
51
|
+
simplecov (0.21.2)
|
52
52
|
docile (~> 1.1)
|
53
53
|
simplecov-html (~> 0.11)
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
simplecov_json_formatter (~> 0.1)
|
55
|
+
simplecov-html (0.12.3)
|
56
|
+
simplecov_json_formatter (0.1.2)
|
57
|
+
unicode-display_width (2.0.0)
|
57
58
|
|
58
59
|
PLATFORMS
|
59
60
|
ruby
|
data/lib/concurrent_executor.rb
CHANGED
@@ -66,10 +66,18 @@ class ConcurrentExecutor
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
+
def metadata
|
70
|
+
{queue_size: queue.size}
|
71
|
+
end
|
72
|
+
|
69
73
|
def work_loop
|
70
74
|
while (work_item = queue.pop)
|
71
75
|
begin
|
72
|
-
executor.
|
76
|
+
if executor.arity == 1
|
77
|
+
executor.call(work_item)
|
78
|
+
else
|
79
|
+
executor.call(work_item, metadata)
|
80
|
+
end
|
73
81
|
rescue StandardError => e
|
74
82
|
@errors << e
|
75
83
|
queue.clear
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: concurrent_executor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Malinconico
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codecov
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.
|
110
|
+
rubygems_version: 3.1.2
|
111
111
|
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Execute things concurrently
|