Properties

$multiHandle

$multiHandle : resource

Type

resource — cURL multi handle.

$requests

$requests : array

Type

array — Attached {@see RequestInterface} objects.

$handles

$handles : \SplObjectStorage

Type

\SplObjectStorage — RequestInterface to CurlHandle hash

$resourceHash

$resourceHash : array

Type

array — Hash mapping curl handle resource IDs to request objects

$exceptions

$exceptions : array

Type

array — Queued exceptions

$successful

$successful : array

Type

array — Requests that succeeded

$multiErrors

$multiErrors : array

Type

array — cURL multi error values and codes

$selectTimeout

$selectTimeout : float

Type

float

Methods

getAllEvents()

getAllEvents() : array

Get a list of all of the events emitted from the class

Returns

array

dispatch()

dispatch(string  $eventName, array  $context = array()) : \Guzzle\Common\Event

Helper to dispatch Guzzle events and set the event name on the event

Parameters

string $eventName

Name of the event to dispatch

array $context

Context of the event

Returns

\Guzzle\Common\Event

Returns the created event object

__construct()

__construct(  $selectTimeout = 1.0) 

Parameters

$selectTimeout

__destruct()

__destruct() 

all()

all() : array

Get an array of attached {@see RequestInterface} objects

Returns

array

remove()

remove(\Guzzle\Http\Message\RequestInterface  $request) : boolean

Remove a request from the pool.

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to remove

Returns

boolean —

Returns true on success or false on failure

reset()

reset(boolean  $hard = false) 

Reset the state and remove any attached RequestInterface objects

Parameters

boolean $hard

Set to true to close and reopen any open multi handles

send()

send() 

Send a pool of {@see RequestInterface} requests.

count()

count() 

throwMultiException()

throwMultiException(array  $exceptions, array  $successful) 

Build and throw a MultiTransferException

Parameters

array $exceptions

Exceptions encountered

array $successful

Successful requests

Throws

\Guzzle\Http\Exception\MultiTransferException

beforeSend()

beforeSend(\Guzzle\Http\Message\RequestInterface  $request) 

Prepare for sending

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to prepare

Throws

\Exception

on error preparing the request

perform()

perform() 

Get the data from the multi handle

removeErroredRequest()

removeErroredRequest(\Guzzle\Http\Message\RequestInterface  $request, \Exception  $e = null) 

Remove a request that encountered an exception

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to remove

\Exception $e

Exception encountered

processResponse()

processResponse(\Guzzle\Http\Message\RequestInterface  $request, \Guzzle\Http\Curl\CurlHandle  $handle, array  $curl) 

Check for errors and fix headers of a request based on a curl response

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request to process

\Guzzle\Http\Curl\CurlHandle $handle

Curl handle object

array $curl

Array returned from curl_multi_info_read

Throws

\Guzzle\Http\Exception\CurlException

on Curl error

removeHandle()

removeHandle(\Guzzle\Http\Message\RequestInterface  $request) 

Remove a curl handle from the curl multi object

Parameters

\Guzzle\Http\Message\RequestInterface $request

Request that owns the handle

executeHandles()

executeHandles() 

Execute and select curl handles

processMessages()

processMessages() 

Process any received curl multi messages

checkCurlResult()

checkCurlResult(integer  $code) 

Throw an exception for a cURL multi response if needed

Parameters

integer $code

Curl response code

Throws

\Guzzle\Http\Exception\CurlException