public function CurlMulti::reset

Reset the state and remove any attached RequestInterface objects

Parameters

bool $hard Set to true to close and reopen any open multi handles:

Overrides CurlMultiInterface::reset

1 call to CurlMulti::reset()
CurlMulti::send in drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php
Send a pool of {

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/CurlMulti.php, line 226

Class

CurlMulti
Send { This implementation allows callers to send blocking requests that return back to the caller when their requests complete, regardless of whether or not previously sending requests in the curl_multi object have completed. The implementation…

Namespace

Guzzle\Http\Curl

Code

public function reset($hard = false) {

  // Remove each request
  foreach ($this
    ->all() as $request) {
    $this
      ->remove($request);
  }
  $this->requests = array();
  $this->exceptions = array();
  $this->state = self::STATE_IDLE;
  $this->scope = -1;
  $this->requestCache = null;

  // Remove any curl handles that were queued for removal
  if ($this->scope == -1 || $hard) {
    foreach ($this->removeHandles as $handle) {
      curl_multi_remove_handle($this->multiHandle, $handle
        ->getHandle());
      $handle
        ->close();
    }
    $this->removeHandles = array();
  }
  if ($hard) {
    $this
      ->createMutliHandle();
  }
}