|
static | batch (ClientInterface $client, $requests, array $options=[]) |
| Sends multiple requests concurrently and returns an array of responses and exceptions that uses the same ordering as the provided requests.
|
|
◆ __construct()
GuzzleHttp\Pool::__construct |
( |
ClientInterface | $client, |
|
|
| $requests, |
|
|
array | $config = [] ) |
- Parameters
-
ClientInterface | $client | Client used to send the requests. |
array | Iterator | $requests | Requests or functions that return requests to send concurrently. |
array | $config | Associative array of options
- concurrency: (int) Maximum number of requests to send concurrently
- options: Array of request options to apply to each request.
- fulfilled: (callable) Function to invoke when a request completes.
- rejected: (callable) Function to invoke when a request is rejected.
|
◆ batch()
static GuzzleHttp\Pool::batch |
( |
ClientInterface | $client, |
|
|
| $requests, |
|
|
array | $options = [] ) |
|
static |
Sends multiple requests concurrently and returns an array of responses and exceptions that uses the same ordering as the provided requests.
IMPORTANT: This method keeps every request and response in memory, and as such, is NOT recommended when sending a large number or an indeterminate number of requests concurrently.
- Parameters
-
ClientInterface | $client | Client used to send the requests |
array | Iterator | $requests | Requests to send concurrently. |
array | $options | Passes through the options available in { |
- See also
- GuzzleHttp\Pool\__construct}
- Return values
-
array | Returns an array containing the response or an exception in the same order that the requests were sent. |
- Exceptions
-
InvalidArgumentException | if the event format is incorrect. |
◆ promise()
GuzzleHttp\Pool::promise |
( |
| ) |
|
The documentation for this class was generated from the following file:
- lib/guzzlehttp/guzzle/src/Pool.php