core-async 0.9.0 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/core/async/future.rb +3 -3
- data/lib/core/async/scheduler.rb +9 -6
- data/lib/core/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: 84f855320eba3545932e5019d840f3e7fbcc6c45bba6de79a60dd3101f9ef5e7
|
4
|
+
data.tar.gz: 27a66e580273043a1a3377be330f0365cf27f749320dd1d9108ec72ff01f40e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da5c9211dbd194e0ad48b443635e10b93ef4937f1a677f4de441274b98b3b2509f9800aeb9305fa64ac769487a5085d95dff79cc9d58ff9ee15ea58cc970e05c
|
7
|
+
data.tar.gz: 90be0a94b5ec20888d9c2b6eb2c15e7bb1ea8a8745e28575ff5eaf17ca3ff97377fd4ce2a16e0def9c74830d3ca02ad6b277f227d938a19c401f72327dfde658
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [v0.10.0](https://github.com/metabahn/corerb/releases/tag/2021-11-02)
|
2
|
+
|
3
|
+
*released on 2021-11-02*
|
4
|
+
|
5
|
+
* `chg` [#97](https://github.com/metabahn/corerb/pull/97) Designate internal state with leading and trailing double underscores ([bryanp](https://github.com/bryanp))
|
6
|
+
* `chg` [#95](https://github.com/metabahn/corerb/pull/95) Change the approach to shutting down the scheduler on interrupt ([bryanp](https://github.com/bryanp))
|
7
|
+
|
1
8
|
## [v0.9.0](https://github.com/metabahn/corerb/releases/tag/2021-10-24)
|
2
9
|
|
3
10
|
*released on 2021-10-24*
|
data/lib/core/async/future.rb
CHANGED
@@ -70,7 +70,7 @@ module Core
|
|
70
70
|
when :pending
|
71
71
|
scheduler = Fiber.scheduler
|
72
72
|
|
73
|
-
result = catch :
|
73
|
+
result = catch :__corerb_async_future_failed__ do
|
74
74
|
if scheduler.running?
|
75
75
|
if children
|
76
76
|
resolve_all(@filament)
|
@@ -82,7 +82,7 @@ module Core
|
|
82
82
|
finished = false
|
83
83
|
|
84
84
|
scheduler.fiber do
|
85
|
-
result = catch :
|
85
|
+
result = catch :__corerb_async_future_failed__ do
|
86
86
|
if children
|
87
87
|
resolve_all(@filament)
|
88
88
|
else
|
@@ -178,7 +178,7 @@ module Core
|
|
178
178
|
when self.class
|
179
179
|
resolve_value(value.result)
|
180
180
|
when Failure
|
181
|
-
throw :
|
181
|
+
throw :__corerb_async_future_failed__, value
|
182
182
|
else
|
183
183
|
value
|
184
184
|
end
|
data/lib/core/async/scheduler.rb
CHANGED
@@ -51,9 +51,12 @@ module Core
|
|
51
51
|
|
52
52
|
yield self if block_given?
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
Thread.handle_interrupt(Interrupt => :never) do
|
55
|
+
result = nil
|
56
|
+
|
57
|
+
until Thread.pending_interrupt? || result == :finished
|
58
|
+
result = tick
|
59
|
+
end
|
57
60
|
end
|
58
61
|
ensure
|
59
62
|
@running = false
|
@@ -96,7 +99,7 @@ module Core
|
|
96
99
|
|
97
100
|
@timers.fire
|
98
101
|
rescue Errno::EINTR
|
99
|
-
|
102
|
+
# noop
|
100
103
|
end
|
101
104
|
|
102
105
|
# [public] Stop the scheduler, canceling each scheduled fiber.
|
@@ -111,7 +114,7 @@ module Core
|
|
111
114
|
|
112
115
|
# [public] Cancel the given fiber.
|
113
116
|
#
|
114
|
-
def cancel(fiber = Thread.current[:
|
117
|
+
def cancel(fiber = Thread.current[:__corerb_async_current_fiber__])
|
115
118
|
self.raise(fiber, Cancel) if fiber
|
116
119
|
end
|
117
120
|
|
@@ -162,7 +165,7 @@ module Core
|
|
162
165
|
|
163
166
|
fiber = Fiber.new(blocking: false) {
|
164
167
|
begin
|
165
|
-
Thread.current[:
|
168
|
+
Thread.current[:__corerb_async_current_fiber__] = filament
|
166
169
|
filament.object = fiber
|
167
170
|
result = block.call(filament)
|
168
171
|
rescue Cancel
|
data/lib/core/async/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core-async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: event
|