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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/async/promise.rb +14 -0
- data/lib/async/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c7cade6749e8ff99e40808a8aaf7f334312e1975e4f4e349b96271cbc157caf
|
4
|
+
data.tar.gz: 42d523251a8904087917cb000f26d5b17c5bb69ec45d88cfbb6deebaade1923f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|