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