async 2.8.0 → 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: 375535a1ac14250ee93a95528260ce74c955995cf80b82b0df056a20a316efc8
4
- data.tar.gz: 450d6f08547dbf0e34b6addf16ef4cbec6cf3fc243404fb2db3c58abefa910f6
3
+ metadata.gz: 953c51a9b7552058772c90c36cc99d5a6cd26de3c32d3b424bc5929de81a1960
4
+ data.tar.gz: 63b115b69ea49ba7192982de38b936fc6d07623aa6139ce51ee2000c949ad759
5
5
  SHA512:
6
- metadata.gz: b805b99b26953130cc5423ebecfe9f24a7360f18a655566181d940cdba47ef45261c1b774b4b516750119c6e5a022a78eb0e7f20ca9613c1adf31951403b6fe4
7
- data.tar.gz: 92278bb1cee07e584462aaccb2221efdca7b9f36a78f8096594c57ff195c1a71a1afbd0051a705dcd3e53da54d9ce76167a305df6358fbaaf0c4170eed7ee86e
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.
@@ -212,7 +219,7 @@ module Async
212
219
  timer&.cancel
213
220
  end
214
221
 
215
- if RUBY_ENGINE != "ruby" || RUBY_VERSION >= "3.3.0"
222
+ if RUBY_ENGINE != "ruby" || RUBY_VERSION >= "3.3.1"
216
223
  def io_write(io, buffer, length, offset = 0)
217
224
  fiber = Fiber.current
218
225
 
@@ -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.0"
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.0
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-01-03 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
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []
174
- rubygems_version: 3.4.22
174
+ rubygems_version: 3.5.3
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: A concurrency framework for Ruby.
metadata.gz.sig CHANGED
Binary file