Skip to content

Commit

Permalink
Rename cancellation variables with token in their names
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Oct 8, 2023
1 parent 45993ab commit 0347699
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Connection/ConnectionLimitingPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ public function getStream(Request $request, Cancellation $cancellation): Stream

return HttpStream::fromStream(
$stream,
function (Request $request, Cancellation $cancellationToken) use (
function (Request $request, Cancellation $cancellation) use (
$poolRef,
$connection,
$stream,
$uri
): Response {
try {
$response = $stream->request($request, $cancellationToken);
$response = $stream->request($request, $cancellation);
} catch (\Throwable $e) {
$this->onReadyConnection($connection, $uri);
throw $e;
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/Http1Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ private function request(Request $request, Cancellation $cancellation, Stream $s
$request->setProtocolVersions([$protocolVersion]);

if ($request->getTransferTimeout() > 0) {
$timeoutToken = new TimeoutCancellation($request->getTransferTimeout());
$combinedCancellation = new CompositeCancellation($cancellation, $timeoutToken);
$timeoutCancellation = new TimeoutCancellation($request->getTransferTimeout());
$combinedCancellation = new CompositeCancellation($cancellation, $timeoutCancellation);
} else {
$combinedCancellation = $cancellation;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Connection/StreamLimitingPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public function getStream(Request $request, Cancellation $cancellation): Stream

return HttpStream::fromStream(
$stream,
static function (Request $request, Cancellation $cancellationToken) use (
static function (Request $request, Cancellation $cancellation) use (
$stream,
$lock
): Response {
try {
$response = $stream->request($request, $cancellationToken);
$response = $stream->request($request, $cancellation);
} catch (\Throwable $e) {
$lock->release();
throw $e;
Expand Down
4 changes: 2 additions & 2 deletions src/Interceptor/FollowRedirects.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private function followRedirects(
Request $clonedRequest,
Response $response,
DelegateHttpClient $client,
Cancellation $cancellationToken
Cancellation $cancellation
): Response {
$maxRedirects = $this->maxRedirects;
$requestNr = 2;
Expand All @@ -150,7 +150,7 @@ private function followRedirects(

$clonedRequest = $this->cloneRequest($request);

$redirectResponse = $client->request($request, $cancellationToken);
$redirectResponse = $client->request($request, $cancellation);
$redirectResponse->setPreviousResponse($response);

$response = $redirectResponse;
Expand Down

0 comments on commit 0347699

Please sign in to comment.