Skip to content

Commit a7a4500

Browse files
authored
Merge pull request #57 from WyriHaximus-labs/4.x-explain-fibers-in-changelog
Explain fibers in changelog
2 parents 99bd0fa + e2cbc81 commit a7a4500

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
## [Unreleased]
1010

11+
With this release the promise `wait` function will wait for requests to complete using
12+
[`react/async`'s `await`](https://reactphp.org/async/#await) utilizing fibers. Instead of constantly
13+
start stopping the event loop. As such users are expected to run usage of this adapter in a fiber using
14+
[`react/async`'s `async`](https://reactphp.org/async/#async) like:
15+
16+
```php
17+
use function React\Async\async;
18+
19+
async(static function () {
20+
// Returns a Http\Promise\Promise
21+
$promise = $adapter->sendAsyncRequest(request);
22+
23+
// Returns a Psr\Http\Message\ResponseInterface
24+
$response = $promise->wait();
25+
})();
26+
```
27+
1128
### Changed
1229

1330
- Use PHP 8.1 fibers as async mechanism.
1431
- Detect supported PHP versions in range during CI instead of hardcoding them.
1532

16-
### Changed
17-
1833
## [3.0.1] - 2021-10-20
1934

2035
### Changed

0 commit comments

Comments
 (0)