function CurlMultiHandler::cancel
Cancels a handle from sending and removes references to it.
Parameters
int $id Handle ID to cancel and remove.:
Return value
bool True on success, false on failure.
1 call to CurlMultiHandler::cancel()
- CurlMultiHandler::__invoke in vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlMultiHandler.php
File
-
vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlMultiHandler.php, line 229
Class
- CurlMultiHandler
- Returns an asynchronous response using curl_multi_* functions.
Namespace
GuzzleHttp\HandlerCode
private function cancel($id) : bool {
if (!is_int($id)) {
trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__);
}
// Cannot cancel if it has been processed.
if (!isset($this->handles[$id])) {
return false;
}
$handle = $this->handles[$id]['easy']->handle;
unset($this->delays[$id], $this->handles[$id]);
\curl_multi_remove_handle($this->_mh, $handle);
\curl_close($handle);
return true;
}