async 2.32.1 → 2.33.0

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: 59ef83bbeaff186a176dea0301c0b1772188f21053715a8c3123de07beb0d4a2
4
- data.tar.gz: e03bfe837ec4030ec88a02b4568166fcc78d6b85d2c788592dbe65ec60ffefa6
3
+ metadata.gz: 7c7cade6749e8ff99e40808a8aaf7f334312e1975e4f4e349b96271cbc157caf
4
+ data.tar.gz: 42d523251a8904087917cb000f26d5b17c5bb69ec45d88cfbb6deebaade1923f
5
5
  SHA512:
6
- metadata.gz: 603f5de4548b6d03aa4f8ca15f1e920e3c172c6985fdfbb4f23da9355ad07dc77cffa15a25b1272c14edddb991a90449bd76ca6036930539bd58ea83d0dd3a79
7
- data.tar.gz: 99d9d6129853a7cbb50a41f0778d7225fb02f435e8f06001a18c2acbccb63c1cbd4f1e7145292388a7763ded53a85de548d98c3d5d9f0bfc894f8431414c6d39
6
+ metadata.gz: 13d7fedf21c2ecf283d5e541af4e11f523eefe0c8cc084b7a174483a5483fe6f58d50d8472cd60e393e537d3c12c5312500b54be0f13092ae01ac1ebddd64488
7
+ data.tar.gz: 2cbd88bab04832b9fc23773977e74dd494f4a9cc8b53e9ec45af04fa80bcdbbbe411c3c8b661a4205e36f7d70f1a789b70e20e1b3c4a77ded4d5b5a96658a5a2
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/async/promise.rb CHANGED
@@ -184,5 +184,19 @@ module Async
184
184
  self.resolve(nil) unless @resolved
185
185
  end
186
186
  end
187
+
188
+ # If a promise is given, fulfill it with the result of the block.
189
+ # If no promise is given, simply yield to the block.
190
+ # This is useful for methods that may optionally take a promise to fulfill.
191
+ # @parameter promise [Promise | Nil] The optional promise to fulfill.
192
+ # @yields {...} The block to call to resolve the promise or return a value.
193
+ # @returns [Object] The result of the block.
194
+ def self.fulfill(promise, &block)
195
+ if promise
196
+ return promise.fulfill(&block)
197
+ else
198
+ return yield
199
+ end
200
+ end
187
201
  end
188
202
  end
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.32.1"
7
+ VERSION = "2.33.0"
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.33.0
39
+
40
+ - Introduce `Async::Promise.fulfill` for optional promise resolution.
41
+
38
42
  ### v2.32.1
39
43
 
40
44
  - Fix typo in documentation.
@@ -80,10 +84,6 @@ This release introduces thread-safety as a core concept of Async. Many core clas
80
84
 
81
85
  - Ensure trace attributes are strings, fixes integration with OpenTelemetry.
82
86
 
83
- ### v2.27.2
84
-
85
- - Fix `context/index.yaml` schema.
86
-
87
87
  ## See Also
88
88
 
89
89
  - [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.33.0
4
+
5
+ - Introduce `Async::Promise.fulfill` for optional promise resolution.
6
+
3
7
  ## v2.32.1
4
8
 
5
9
  - Fix typo in documentation.
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.32.1
4
+ version: 2.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file