mirror of
https://github.com/danog/amp.git
synced 2024-12-04 02:17:54 +01:00
Fix documentation in CancellationTokenSource
This commit is contained in:
parent
2645e0fd84
commit
5bd21bed06
@ -16,13 +16,13 @@ namespace Amp;
|
|||||||
* **Example**
|
* **Example**
|
||||||
*
|
*
|
||||||
* ```php
|
* ```php
|
||||||
* $tokenSource = new CancellationTokenSource;
|
* $cancellationTokenSource = new CancellationTokenSource;
|
||||||
* $token = $tokenSource->getToken();
|
* $cancellationToken = $cancellationTokenSource->getToken();
|
||||||
*
|
*
|
||||||
* $response = yield $httpClient->request("https://example.com/pipeline", $token);
|
* $response = $httpClient->request("https://example.com/pipeline", $cancellationToken);
|
||||||
* $responseBody = $response->getBody();
|
* $responseBody = $response->getBody();
|
||||||
*
|
*
|
||||||
* while (($chunk = yield $response->read()) !== null) {
|
* while (null !== $chunk = $response->read()) {
|
||||||
* // consume $chunk
|
* // consume $chunk
|
||||||
*
|
*
|
||||||
* if ($noLongerInterested) {
|
* if ($noLongerInterested) {
|
||||||
|
Loading…
Reference in New Issue
Block a user