1
0
mirror of https://github.com/danog/amp.git synced 2024-12-11 17:09:40 +01:00

Fix documentation in CancellationTokenSource

This commit is contained in:
Niklas Keller 2021-12-02 21:52:45 +01:00
parent 2645e0fd84
commit 5bd21bed06

View File

@ -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) {