Skip to content

Commit 11ab05e

Browse files
committed
Use reactphp/async instead of clue/reactphp-block
1 parent 3909651 commit 11ab05e

File tree

4 files changed

+56
-60
lines changed

4 files changed

+56
-60
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,17 @@ If this looks strange to you, you can also use the more traditional [blocking AP
155155
As stated above, this library provides you a powerful, async API by default.
156156

157157
If, however, you want to integrate this into your traditional, blocking environment,
158-
you should look into also using [clue/reactphp-block](https://github.com/clue/reactphp-block).
158+
you should look into also using [reactphp/async](https://github.com/reactphp/async).
159159

160160
The resulting blocking code could look something like this:
161161

162162
```php
163-
use Clue\React\Block;
164-
165163
$client = new Clue\React\Docker\Client();
166164

167165
$promise = $client->imageInspect('busybox');
168166

169167
try {
170-
$results = Block\await($promise, Loop::get());
168+
$results = \React\Async\await($promise);
171169
// resporesults successfully received
172170
} catch (Exception $e) {
173171
// an error occured while performing the request
@@ -182,10 +180,10 @@ $promises = array(
182180
$client->imageInspect('ubuntu'),
183181
);
184182

185-
$inspections = Block\awaitAll($promises, Loop::get());
183+
$inspections = \React\Async\await(\React\Async\parallel($promises));
186184
```
187185

188-
Please refer to [clue/reactphp-block](https://github.com/clue/reactphp-block#readme) for more details.
186+
Please refer to [reactphp/async](https://github.com/reactphp/async#readme) for more details.
189187

190188
#### Command streaming
191189

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"rize/uri-template": "^0.3"
2929
},
3030
"require-dev": {
31-
"clue/block-react": "^1.5",
31+
"react/async": "^4 || ^3 || ^2",
3232
"clue/caret-notation": "^0.2",
3333
"clue/tar-react": "^0.2",
3434
"phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.35"

0 commit comments

Comments
 (0)