@@ -33,7 +33,7 @@ into your traditional, synchronous (blocking) application stack.
3333### Quickstart example
3434
3535The following example code demonstrates how this library can be used along with
36- an [ async HTTP client] ( https://github.com/clue/ reactphp-buzz ) to process two
36+ an [ async HTTP client] ( https://github.com/reactphp/http#client-usage ) to process two
3737non-blocking HTTP requests and block until the first (faster) one resolves.
3838
3939``` php
@@ -44,7 +44,7 @@ function blockingExample()
4444
4545 // this example uses an HTTP client
4646 // this could be pretty much everything that binds to an event loop
47- $browser = new Clue\ React\Buzz \Browser($loop);
47+ $browser = new React\Http \Browser($loop);
4848
4949 // set up two parallel requests
5050 $request1 = $browser->get('http://www.google.com/');
@@ -128,14 +128,16 @@ will throw an `UnexpectedValueException` instead.
128128``` php
129129try {
130130 $result = Block\await($promise, $loop);
131- // promise successfully fulfilled with $value
131+ // promise successfully fulfilled with $result
132132 echo 'Result: ' . $result;
133133} catch (Exception $exception) {
134134 // promise rejected with $exception
135135 echo 'ERROR: ' . $exception->getMessage();
136136}
137137```
138138
139+ See also the [ examples] ( examples/ ) .
140+
139141If no ` $timeout ` argument is given and the promise stays pending, then this
140142will potentially wait/block forever until the promise is settled.
141143
@@ -160,6 +162,8 @@ $firstResult = Block\awaitAny($promises, $loop, $timeout);
160162echo 'First result: ' . $firstResult;
161163```
162164
165+ See also the [ examples] ( examples/ ) .
166+
163167This function will only return after ANY of the given ` $promises ` has been
164168fulfilled or will throw when ALL of them have been rejected. In the meantime,
165169the event loop will run any events attached to the same loop.
@@ -195,6 +199,8 @@ $allResults = Block\awaitAll($promises, $loop, $timeout);
195199echo 'First promise resolved with: ' . $allResults[0];
196200```
197201
202+ See also the [ examples] ( examples/ ) .
203+
198204This function will only return after ALL of the given ` $promises ` have been
199205fulfilled or will throw when ANY of them have been rejected. In the meantime,
200206the event loop will run any events attached to the same loop.
0 commit comments