async 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/async/barrier.rb +4 -4
- data/lib/async/semaphore.rb +3 -3
- data/lib/async/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: 54242c72b2d813b19ca5720e42810fed147dc8b287a541d937b4b5b269d21853
|
4
|
+
data.tar.gz: 994b539a0c57f1d88dc9fbe1337f6d7757d042e92b617bff6078b253dced5194
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4b6ac679779d60c72a379534ac3b83adb1e9c8633afcc3aba4679cc5f6d4491572fde39ab663cc170ae47db33b1cfbbe1a7e3611be87427224372c65853629
|
7
|
+
data.tar.gz: 863fc5ed61d8380698ab6ed48d6b7f738708bb408157d6de4d4cd58b36d3022db91dfa6e295e5eb547e71bbce17867767adc1467f5ca966bd13cf4a078aabc07
|
data/lib/async/barrier.rb
CHANGED
@@ -30,12 +30,12 @@ module Async
|
|
30
30
|
# All tasks which have been invoked into the barrier.
|
31
31
|
attr :tasks
|
32
32
|
|
33
|
-
def async(*args,
|
34
|
-
|
33
|
+
def async(*args, task: Task.current, **options, &block)
|
34
|
+
subtask = task.async(*args, **options, &block)
|
35
35
|
|
36
|
-
@tasks <<
|
36
|
+
@tasks << subtask
|
37
37
|
|
38
|
-
return
|
38
|
+
return subtask
|
39
39
|
end
|
40
40
|
|
41
41
|
def empty?
|
data/lib/async/semaphore.rb
CHANGED
@@ -47,14 +47,14 @@ module Async
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# Run an async task. Will wait until the semaphore is ready until spawning and running the task.
|
50
|
-
def async(*args,
|
50
|
+
def async(*args, task: Task.current, **options)
|
51
51
|
wait
|
52
52
|
|
53
|
-
|
53
|
+
task.async(**options) do |subtask|
|
54
54
|
@count += 1
|
55
55
|
|
56
56
|
begin
|
57
|
-
yield
|
57
|
+
yield subtask, *args
|
58
58
|
ensure
|
59
59
|
self.release
|
60
60
|
end
|
data/lib/async/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.22.
|
4
|
+
version: 1.22.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nio4r
|