CurlMultiInterface
extends
Countable, HasDispatcherInterface
in
Interface for sending a pool of {@see RequestInterface} objects in parallel
Table of Contents
Constants
- ADD_REQUEST = 'curl_multi.add_request'
- BLOCKING = 'curl_multi.blocking'
- MULTI_EXCEPTION = 'curl_multi.exception'
- POLLING_REQUEST = 'curl_multi.polling_request'
- REMOVE_REQUEST = 'curl_multi.remove_request'
Methods
- add() : CurlMultiInterface
- Add a request to the pool.
- addSubscriber() : self
- Add an event subscriber to the dispatcher
- all() : array<string|int, mixed>
- Get an array of attached {@see RequestInterface} objects
- dispatch() : Event
- Helper to dispatch Guzzle events and set the event name on the event
- getAllEvents() : array<string|int, mixed>
- Get a list of all of the events emitted from the class
- getEventDispatcher() : EventDispatcherInterface
- Get the EventDispatcher of the request
- remove() : bool
- Remove a request from the pool.
- reset() : mixed
- Reset the state and remove any attached RequestInterface objects
- send() : mixed
- Send a pool of {@see RequestInterface} requests.
- setEventDispatcher() : self
- Set the EventDispatcher of the request
Constants
ADD_REQUEST
public
mixed
ADD_REQUEST
= 'curl_multi.add_request'
BLOCKING
public
mixed
BLOCKING
= 'curl_multi.blocking'
MULTI_EXCEPTION
public
mixed
MULTI_EXCEPTION
= 'curl_multi.exception'
POLLING_REQUEST
public
mixed
POLLING_REQUEST
= 'curl_multi.polling_request'
REMOVE_REQUEST
public
mixed
REMOVE_REQUEST
= 'curl_multi.remove_request'
Methods
add()
Add a request to the pool.
public
add(RequestInterface $request) : CurlMultiInterface
Parameters
- $request : RequestInterface
-
Request to add
Return values
CurlMultiInterfaceaddSubscriber()
Add an event subscriber to the dispatcher
public
addSubscriber(EventSubscriberInterface $subscriber) : self
Parameters
- $subscriber : EventSubscriberInterface
-
Event subscriber
Return values
selfall()
Get an array of attached {@see RequestInterface} objects
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed>dispatch()
Helper to dispatch Guzzle events and set the event name on the event
public
dispatch(string $eventName[, array<string|int, mixed> $context = array() ]) : Event
Parameters
- $eventName : string
-
Name of the event to dispatch
- $context : array<string|int, mixed> = array()
-
Context of the event
Return values
Event —Returns the created event object
getAllEvents()
Get a list of all of the events emitted from the class
public
static getAllEvents() : array<string|int, mixed>
Return values
array<string|int, mixed>getEventDispatcher()
Get the EventDispatcher of the request
public
getEventDispatcher() : EventDispatcherInterface
Return values
EventDispatcherInterfaceremove()
Remove a request from the pool.
public
remove(RequestInterface $request) : bool
Parameters
- $request : RequestInterface
-
Request to remove
Return values
bool —Returns true on success or false on failure
reset()
Reset the state and remove any attached RequestInterface objects
public
reset([bool $hard = false ]) : mixed
Parameters
- $hard : bool = false
-
Set to true to close and reopen any open multi handles
send()
Send a pool of {@see RequestInterface} requests.
public
send() : mixed
Tags
setEventDispatcher()
Set the EventDispatcher of the request
public
setEventDispatcher(EventDispatcherInterface $eventDispatcher) : self
Parameters
- $eventDispatcher : EventDispatcherInterface