Copied!

Returns an asynchronous response using curlmulti* 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.

  • property resource | CurlMultiHandle $_mh Internal use only. Lazy loaded multi-handle.
  • final
Cloneable Instantiable
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 )
 
  • 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 $active
 
  • var resource | CurlMultiHandle | null the currently executing resource in `curl_multi_exec`.
private $delays
 
  • var array An array of delay times, indexed by handle id in `addRequest`.
  • see \CurlMultiHandler::addRequest
private $factory
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
 
  • var int
Methods
private addRequest ( array $entry ) : void
private cancel ( $id ) : bool
 

Cancels a handle from sending and removes references to it.

  • return bool True on success, false on failure.
private processMessages () : void
private timeToNext () : int
© 2020 Bruce Wells
Search Namespaces \ Classes
Configuration Numbers (0-9.) only