<?phpnamespaceGuzzle\Http\Curl;
useGuzzle\Common\HasDispatcherInterface;
useGuzzle\Common\Exception\ExceptionCollection;
useGuzzle\Http\Message\RequestInterface;
/**
* Interface for sending a pool of {@see RequestInterface} objects in parallel
*/interfaceCurlMultiInterfaceextends HasDispatcherInterface, \Countable {
constBEFORE_SEND = 'curl_multi.before_send';
constPOLLING_REQUEST = 'curl_multi.polling_request';
constCOMPLETE = 'curl_multi.complete';
constADD_REQUEST = 'curl_multi.add_request';
constREMOVE_REQUEST = 'curl_multi.remove_request';
constMULTI_EXCEPTION = 'curl_multi.exception';
constSTATE_IDLE = 'idle';
constSTATE_SENDING = 'sending';
constSTATE_COMPLETE = 'complete';
/**
* Add a request to the pool.
*
* @param RequestInterface $request Request to add
*
* @return CurlMultiInterface
*/
public functionadd(RequestInterface $request);
/**
* Get an array of attached {@see RequestInterface} objects
*
* @return array
*/
public functionall();
/**
* Get the current state of the Pool
*
* @return string
*/
public functiongetState();
/**
* Remove a request from the pool.
*
* @param RequestInterface $request Request to remove
*
* @return CurlMultiInterface
*/
public functionremove(RequestInterface $request);
/**
* Reset the state and remove any attached RequestInterface objects
*
* @param bool $hard Set to true to close and reopen any open multi handles
*/
public functionreset($hard = false);
/**
* Send a pool of {@see RequestInterface} requests.
*
* @throws ExceptionCollection if any requests threw exceptions during the transfer.
*/
public functionsend();
}