Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CurlMultiHandler.php

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\Handler

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal