Copied!

Returns an asynchronous response using curl_multi_* functions.

When using the CurlMultiHandler, custom curl options can be specified as an associative array of curl option constants mapping to values in the curl key of the provided request options.

  • final
CloneableInstantiable
Methods
public __construct(array $options = [])
 

This handler accepts the following options:

  • handle_factory: An optional factory used to create curl handles
  • select_timeout: Optional timeout (in seconds) to block before timing out while selecting curl handles. Defaults to 1 second.
  • options: An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
public __destruct()
public __get( $name)
 
  • param string $name
  • return resource|\CurlMultiHandle
  • throws \BadMethodCallException when another field as _mh will be gotten
  • throws \RuntimeException when curl can not initialize a multi handle
public __invoke(Psr\Http\Message\RequestInterface $request, array $options) : GuzzleHttp\Promise\PromiseInterface
public execute() : void
 

Runs until all outstanding connections have completed.

public tick() : void
 

Ticks the curl event loop.

Properties
private $_mh = NULL
 
  • var resource|\CurlMultiHandle
private $active = 0
 
  • var int Will be higher than 0 when curl_multi_exec is still running.
private $delays = []
 
  • var array<int,float> An array of delay times, indexed by handle id in addRequest.
  • see \CurlMultiHandler::addRequest
private $factory = NULL
 
  • var \CurlFactoryInterface
private $handles = []
 
  • var array Request entry handles, indexed by handle id in addRequest.
  • see \CurlMultiHandler::addRequest
private $options = []
 
  • var array An associative array of CURLMOPT_* options and corresponding values for curl_multi_setopt()
private $selectTimeout = NULL
 
  • var int
Methods
private addRequest(array $entry) : void
private cancel( $id) : bool
 

Cancels a handle from sending and removes references to it.

  • param int $id Handle ID to cancel and remove.
  • return bool True on success, false on failure.
private processMessages() : void
private timeToNext() : int
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration