@@ -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+ // response results successfully received
172171} catch (Exception $e) {
173172 // an error occured while performing the request
174173}
@@ -177,15 +176,19 @@ 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+
180181$promises = array(
181182 $client->imageInspect('busybox'),
182183 $client->imageInspect('ubuntu'),
183184);
184185
185- $inspections = Block\awaitAll( $promises, Loop::get( ));
186+ $inspections = await(all( $promises));
186187```
187188
188- Please refer to [ clue/reactphp-block] ( https://github.com/clue/reactphp-block#readme ) for more details.
189+ This is made possible thanks to fibers available in PHP 8.1+ and our
190+ compatibility API that also works on all supported PHP versions.
191+ Please refer to [ reactphp/async] ( https://github.com/reactphp/async#readme ) for more details.
189192
190193#### Command streaming
191194
0 commit comments