1
0
mirror of https://github.com/danog/amp.git synced 2024-12-04 10:28:01 +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** * **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) {