async 2.28.0 → 2.28.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3d7b98c33c331424b3e803d3081ee28abc72ca52e910cc0ee49a51a1a90d8f0
4
- data.tar.gz: 306153a2296017bfb169251642c9b64409b5152b98a28e49b1e02158b5c69634
3
+ metadata.gz: efc7dde75b60834caa61f17a3f742ff7836422c0dbc8ab6dc0f67392c00bff0e
4
+ data.tar.gz: ee3ffc8bab4adc4f98c5df81dda26f74266eb12512aba815b65cab587bb280e5
5
5
  SHA512:
6
- metadata.gz: 580a4f849c6344fd1968c7376b801ce5ed2ee1a3eb79390793f1e9a3c370f12abb2a5664d46cf3b6d75067896365fd762ccdcf491a3fdf25471458284ac86fa2
7
- data.tar.gz: 914a5d6bcfaca6c91bf8437b9d5d3e0c894d9666c3819a0c822cc1173af44ce92c9ae4ce901cc1292543d5624c58aa693aed8a4e0ae9e96a7b7c8b9150bc003d
6
+ metadata.gz: 239dfdc750425c0ac90abdf981faa3358593b2d4aa782897e9b7b073fddff04d631606d6bd61d60904fbdd71fb91536dddae5b63343d831a850d67d7ee9782b7
7
+ data.tar.gz: 83d4af2ab658fef715ad268cb936bbc30851948135b935191d7bdaecad45d7eef9d3f988b8c0857129d4bff0d58648724410ee16671639a7c64d718526e7a175
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/barrier.rb CHANGED
@@ -43,6 +43,8 @@ module Async
43
43
  # Execute a child task and add it to the barrier.
44
44
  # @asynchronous Executes the given block concurrently.
45
45
  def async(*arguments, parent: (@parent or Task.current), **options, &block)
46
+ raise "Barrier is stopped!" if @finished.closed?
47
+
46
48
  waiting = nil
47
49
 
48
50
  parent.async(*arguments, **options) do |task, *arguments|
@@ -50,7 +52,7 @@ module Async
50
52
  @tasks.append(waiting)
51
53
  block.call(task, *arguments)
52
54
  ensure
53
- @finished.signal(waiting)
55
+ @finished.signal(waiting) unless @finished.closed?
54
56
  end
55
57
  end
56
58
 
data/lib/async/queue.rb CHANGED
@@ -32,6 +32,11 @@ module Async
32
32
  @available = available
33
33
  end
34
34
 
35
+ # @returns [Boolean] Whether the queue is closed.
36
+ def closed?
37
+ @closed
38
+ end
39
+
35
40
  # Close the queue, causing all waiting tasks to return `nil`. Any subsequent calls to {enqueue} will raise an exception.
36
41
  def close
37
42
  @closed = true
data/lib/async/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2017-2025, by Samuel Williams.
5
5
 
6
6
  module Async
7
- VERSION = "2.28.0"
7
+ VERSION = "2.28.1"
8
8
  end
data/readme.md CHANGED
@@ -35,6 +35,10 @@ Please see the [project documentation](https://socketry.github.io/async/) for mo
35
35
 
36
36
  Please see the [project releases](https://socketry.github.io/async/releases/index) for all releases.
37
37
 
38
+ ### v2.28.1
39
+
40
+ - Fix race condition between `Async::Barrier#stop` and finish signalling.
41
+
38
42
  ### v2.28.0
39
43
 
40
44
  - Use `Traces.current_context` and `Traces.with_context` for better integration with OpenTelemetry.
@@ -83,11 +87,6 @@ Please see the [project releases](https://socketry.github.io/async/releases/inde
83
87
  - `Async::Wrapper` which was previously deprecated, is now removed.
84
88
  - [Flexible Timeouts](https://socketry.github.io/async/releases/index#flexible-timeouts)
85
89
 
86
- ### v2.23.0
87
-
88
- - Rename `ASYNC_SCHEDULER_DEFAULT_WORKER_POOL` to `ASYNC_SCHEDULER_WORKER_POOL`.
89
- - [Fiber Stall Profiler](https://socketry.github.io/async/releases/index#fiber-stall-profiler)
90
-
91
90
  ## See Also
92
91
 
93
92
  - [async-http](https://github.com/socketry/async-http) — Asynchronous HTTP client/server.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v2.28.1
4
+
5
+ - Fix race condition between `Async::Barrier#stop` and finish signalling.
6
+
3
7
  ## v2.28.0
4
8
 
5
9
  - Use `Traces.current_context` and `Traces.with_context` for better integration with OpenTelemetry.
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.28.0
4
+ version: 2.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file