async 2.8.1 → 2.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/scheduler.rb +12 -2
- data/lib/async/task.rb +2 -2
- 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: 953c51a9b7552058772c90c36cc99d5a6cd26de3c32d3b424bc5929de81a1960
|
4
|
+
data.tar.gz: 63b115b69ea49ba7192982de38b936fc6d07623aa6139ce51ee2000c949ad759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3023d786331d88fbb94c36b0ab1597f123e5794d410773b9005dfc6df8212c91d106cbeb8506c1c6725e059ac6e82ed1e77667c595d033eb2ff5ea9d9de681f2
|
7
|
+
data.tar.gz: 31c4192c27d349f045fa25ba2165948630da063abe5369512def7c54d653961ee5c7d2e82ec36808910a26f81f51c23d6674e1b4993888936410d7649cbd2ec0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/async/scheduler.rb
CHANGED
@@ -49,6 +49,13 @@ module Async
|
|
49
49
|
self.close
|
50
50
|
end
|
51
51
|
|
52
|
+
# Terminate the scheduler. We deliberately ignore interrupts here, as this code can be called from an interrupt, and we don't want to be interrupted while cleaning up.
|
53
|
+
def terminate
|
54
|
+
Thread.handle_interrupt(::Interrupt => :never) do
|
55
|
+
super
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
52
59
|
# @public Since `stable-v1`.
|
53
60
|
def close
|
54
61
|
# It's critical to stop all tasks. Otherwise they might be holding on to resources which are never closed/released correctly.
|
@@ -308,7 +315,7 @@ module Async
|
|
308
315
|
|
309
316
|
begin
|
310
317
|
# 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.
|
311
|
-
Thread.handle_interrupt(SignalException => :never) do
|
318
|
+
Thread.handle_interrupt(::SignalException => :never) do
|
312
319
|
while true
|
313
320
|
# If we are interrupted, we need to exit:
|
314
321
|
break if self.interrupted?
|
@@ -318,7 +325,10 @@ module Async
|
|
318
325
|
end
|
319
326
|
end
|
320
327
|
rescue Interrupt
|
321
|
-
|
328
|
+
Thread.handle_interrupt(::SignalException => :never) do
|
329
|
+
self.stop
|
330
|
+
end
|
331
|
+
|
322
332
|
retry
|
323
333
|
end
|
324
334
|
|
data/lib/async/task.rb
CHANGED
@@ -209,7 +209,7 @@ module Async
|
|
209
209
|
def stop(later = false)
|
210
210
|
if self.stopped?
|
211
211
|
# If we already stopped this task... don't try to stop it again:
|
212
|
-
return
|
212
|
+
return stopped!
|
213
213
|
end
|
214
214
|
|
215
215
|
# If the fiber is alive, we need to stop it:
|
@@ -304,7 +304,7 @@ module Async
|
|
304
304
|
stopped = false
|
305
305
|
|
306
306
|
begin
|
307
|
-
# We are
|
307
|
+
# We are not running, but children might be so we should stop them:
|
308
308
|
stop_children(true)
|
309
309
|
rescue Stop
|
310
310
|
stopped = true
|
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.8.
|
4
|
+
version: 2.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -61,7 +61,7 @@ cert_chain:
|
|
61
61
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
62
62
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
63
63
|
-----END CERTIFICATE-----
|
64
|
-
date: 2024-02-
|
64
|
+
date: 2024-02-24 00:00:00.000000000 Z
|
65
65
|
dependencies:
|
66
66
|
- !ruby/object:Gem::Dependency
|
67
67
|
name: console
|
metadata.gz.sig
CHANGED
Binary file
|