@@ -154,21 +154,20 @@ If this looks strange to you, you can also use the more traditional [blocking AP
154154
155155As stated above, this library provides you a powerful, async API by default.
156156
157- 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 ) .
159-
160- The resulting blocking code could look something like this:
157+ You can also integrate this into your traditional, blocking environment by using
158+ [ reactphp/async] ( https://github.com/reactphp/async ) . This allows you to simply
159+ await commands on the client like this:
161160
162161``` php
163- use Clue\ React\Block ;
162+ use function React\Async\await ;
164163
165164$client = new Clue\React\Docker\Client();
166165
167166$promise = $client->imageInspect('busybox');
168167
169168try {
170- $results = Block\ await($promise, Loop::get() );
171- // resporesults successfully received
169+ $results = await($promise);
170+ // results successfully received
172171} catch (Exception $e) {
173172 // an error occured while performing the request
174173}
@@ -177,15 +176,20 @@ try {
177176Similarly, you can also process multiple commands concurrently and await an array of results:
178177
179178``` php
179+ use function React\Async\await;
180+ use function React\Promise\all;
181+
180182$promises = array(
181183 $client->imageInspect('busybox'),
182184 $client->imageInspect('ubuntu'),
183185);
184186
185- $inspections = Block\awaitAll( $promises, Loop::get( ));
187+ $inspections = await(all( $promises));
186188```
187189
188- Please refer to [ clue/reactphp-block] ( https://github.com/clue/reactphp-block#readme ) for more details.
190+ This is made possible thanks to fibers available in PHP 8.1+ and our
191+ compatibility API that also works on all supported PHP versions.
192+ Please refer to [ reactphp/async] ( https://github.com/reactphp/async#readme ) for more details.
189193
190194#### Command streaming
191195
0 commit comments