async 2.15.1 → 2.15.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: d69239cbc022fd8b50e28bac6356f037ae0ff221605f9309312b1b8566b61ac1
4
- data.tar.gz: ba47d3b3f2d50e4999eb219338ab9e3d619882c9b3de3b000c07a6f2dca89d21
3
+ metadata.gz: be0c94dc887562681bc88ba244ed1bdd85ff41cd5707b22208c44fde725459d0
4
+ data.tar.gz: d91b6f27e96fb9c892fda055cdfb7bcc6564d89e9a02da3f9cf95c248d989360
5
5
  SHA512:
6
- metadata.gz: 6ddd53973722c47e13f92c93149cdc5a111af55af22a9d810aaddbe29fe6b996937737b929556dec48c22deab204d8113574892bb6f2095e991aea62a9188529
7
- data.tar.gz: 2c2c81505e97ebe5fe28fde6abe3eeed7641f5f6e4ead801432c31b60e85d378a6b823bcd97903d11cbfdd3f937f40e80ee288f0e6fb2c961884358c0d30c905
6
+ metadata.gz: 1ec8529ee1df127e0527eb7346b9b606a3767c9ca51b812616d758e0ef2f83687829f9b70d517e4e0f18dd56b169e07fa0df9339fd96393e51388c2fb837eaaf
7
+ data.tar.gz: 777d6eb933f5907504a129f3320f36bc3f9c199b5054d24c2bbdcdebb3d3f598bb064282cd7e07b8e75760cd7872119a4aa6c2d73df43b33dc42f60f1358cfd2
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/task.rb CHANGED
@@ -253,18 +253,18 @@ module Async
253
253
  return stopped!
254
254
  end
255
255
 
256
- # If we are deferring stop...
257
- if @defer_stop == false
258
- # Don't stop now... but update the state so we know we need to stop later.
259
- @defer_stop = true
260
- return false
261
- end
262
-
263
256
  # If the fiber is alive, we need to stop it:
264
257
  if @fiber&.alive?
265
258
  # As the task is now exiting, we want to ensure the event loop continues to execute until the task finishes.
266
259
  self.transient = false
267
260
 
261
+ # If we are deferring stop...
262
+ if @defer_stop == false
263
+ # Don't stop now... but update the state so we know we need to stop later.
264
+ @defer_stop = true
265
+ return false
266
+ end
267
+
268
268
  if self.current?
269
269
  # If the fiber is current, and later is `true`, we need to schedule the fiber to be stopped later, as it's currently invoking `stop`:
270
270
  if later
@@ -326,6 +326,11 @@ module Async
326
326
  end
327
327
  end
328
328
 
329
+ # @returns [Boolean] Whether stop has been deferred.
330
+ def stop_deferred?
331
+ @defer_stop
332
+ end
333
+
329
334
  # Lookup the {Task} for the current fiber. Raise `RuntimeError` if none is available.
330
335
  # @returns [Task]
331
336
  # @raises[RuntimeError] If task was not {set!} for the current fiber.
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.15.1"
7
+ VERSION = "2.15.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.15.1
4
+ version: 2.15.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
- rubygems_version: 3.5.13
170
+ rubygems_version: 3.5.11
171
171
  signing_key:
172
172
  specification_version: 4
173
173
  summary: A concurrency framework for Ruby.
metadata.gz.sig CHANGED
Binary file