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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a69de1047d88273699e4b64e4013edd63e30ad62d0fd8a05cf5bab46bd9ea12b
4
- data.tar.gz: cfe211dafcd8ffc86ee3c4e91a90bc2de919173e7a60a9bdcfb008d1b5c7b67a
3
+ metadata.gz: 953c51a9b7552058772c90c36cc99d5a6cd26de3c32d3b424bc5929de81a1960
4
+ data.tar.gz: 63b115b69ea49ba7192982de38b936fc6d07623aa6139ce51ee2000c949ad759
5
5
  SHA512:
6
- metadata.gz: da268decbc3c7d103d7b4c245059afa04629de91be9dee4baecca1b6df8905a6dfd0797494e93907fde00978cc44f197707391f97cf3453d354cf6f28be8ec5c
7
- data.tar.gz: 14a57522fc67231c827e41be8df02aaba356a06ae700297200bfbbd9ee4579807fb8df8281d29100d15256a1cb2f662f264262fa82897ead48690e4c0423e0f7
6
+ metadata.gz: 3023d786331d88fbb94c36b0ab1597f123e5794d410773b9005dfc6df8212c91d106cbeb8506c1c6725e059ac6e82ed1e77667c595d033eb2ff5ea9d9de681f2
7
+ data.tar.gz: 31c4192c27d349f045fa25ba2165948630da063abe5369512def7c54d653961ee5c7d2e82ec36808910a26f81f51c23d6674e1b4993888936410d7649cbd2ec0
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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
- self.stop
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 bnot running, but children might be so we should stop them:
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
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2024, by Samuel Williams.
5
5
 
6
6
  module Async
7
- VERSION = "2.8.1"
7
+ VERSION = "2.8.2"
8
8
  end
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.1
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-01 00:00:00.000000000 Z
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