async 2.6.0 → 2.6.2
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
- checksums.yaml.gz.sig +0 -0
- data/lib/async/scheduler.rb +17 -4
- data/lib/async/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca106126076f17e48b0374812121cb9d30bc9e5eac981b52407db946ce41e00
|
4
|
+
data.tar.gz: '0302068031a9aee009ec0fbf1a5045fdae48031f4c2f2ff1914f45c292dd6915'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865d56ad3386151e7f417fe00343946be99ae60d620948718e28856aa59fc7f82e8ba28debebb3d025c3a852878456b940dc7e99a1f3a7591873ac7d3a139b2b
|
7
|
+
data.tar.gz: 90d108eb53e337ad33b8655c70aaeb22acc64eba534a7096cd9053938ab3654858e4a72a7d2872ffaaa7c708ba2049c629c30a7a00ace4b370f799e99da85525
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/scheduler.rb
CHANGED
@@ -50,7 +50,7 @@ module Async
|
|
50
50
|
def close
|
51
51
|
# It's critical to stop all tasks. Otherwise they might be holding on to resources which are never closed/released correctly.
|
52
52
|
until self.terminate
|
53
|
-
self.run_once
|
53
|
+
self.run_once!
|
54
54
|
end
|
55
55
|
|
56
56
|
Kernel.raise "Closing scheduler with blocked operations!" if @blocked > 0
|
@@ -215,6 +215,16 @@ module Async
|
|
215
215
|
return false
|
216
216
|
end
|
217
217
|
|
218
|
+
return run_once!(timeout)
|
219
|
+
end
|
220
|
+
|
221
|
+
# Run one iteration of the event loop.
|
222
|
+
#
|
223
|
+
# When terminating the event loop, we already know we are finished. So we don't need to check the task tree. This is a logical requirement because `run_once` ignores transient tasks. For example, a single top level transient task is not enough to keep the reactor running, but during termination we must still process it in order to terminate child tasks.
|
224
|
+
#
|
225
|
+
# @parameter timeout [Float | Nil] The maximum timeout, or if nil, indefinite.
|
226
|
+
# @returns [Boolean] Whether there is more work to do.
|
227
|
+
private def run_once!(timeout = 0)
|
218
228
|
interval = @timers.wait_interval
|
219
229
|
|
220
230
|
# If there is no interval to wait (thus no timers), and no tasks, we could be done:
|
@@ -248,9 +258,12 @@ module Async
|
|
248
258
|
|
249
259
|
@interrupted = false
|
250
260
|
|
251
|
-
|
252
|
-
|
253
|
-
|
261
|
+
# In theory, we could use Exception here to be a little bit safer, but we've only shown the case for SignalException to be a problem, so let's not over-engineer this.
|
262
|
+
Thread.handle_interrupt(SignalException => :never) do
|
263
|
+
while self.run_once
|
264
|
+
if @interrupted || Thread.pending_interrupt?
|
265
|
+
break
|
266
|
+
end
|
254
267
|
end
|
255
268
|
end
|
256
269
|
|
data/lib/async/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: async
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.6.
|
4
|
+
version: 2.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -56,7 +56,7 @@ cert_chain:
|
|
56
56
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
57
57
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
58
58
|
-----END CERTIFICATE-----
|
59
|
-
date: 2023-06-
|
59
|
+
date: 2023-06-13 00:00:00.000000000 Z
|
60
60
|
dependencies:
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: console
|
metadata.gz.sig
CHANGED
Binary file
|