Returns an asynchronous response using curl_multi_* 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.
- Full name:
\GuzzleHttp\Handler\CurlMultiHandler
private \GuzzleHttp\Handler\CurlFactoryInterface $factory
private int $selectTimeout
private int $active
private array $handles
See Also:
- \GuzzleHttp\Handler\CurlMultiHandler::addRequest -
private array<int,float> $delays
See Also:
- \GuzzleHttp\Handler\CurlMultiHandler::addRequest -
private array $options
This handler accepts the following options:
public __construct(array $options = []): mixed
- 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()
Parameters:
Parameter | Type | Description |
---|---|---|
$options |
array |
public __get(string $name): resource|\CurlMultiHandle
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string |
public __destruct(): mixed
public __invoke(\Psr\Http\Message\RequestInterface $request, array $options): \GuzzleHttp\Promise\PromiseInterface
Parameters:
Parameter | Type | Description |
---|---|---|
$request |
\Psr\Http\Message\RequestInterface | |
$options |
array |
Ticks the curl event loop.
public tick(): void
Runs until all outstanding connections have completed.
public execute(): void
private addRequest(array $entry): void
Parameters:
Parameter | Type | Description |
---|---|---|
$entry |
array |
Cancels a handle from sending and removes references to it.
private cancel(int $id): bool
Parameters:
Parameter | Type | Description |
---|---|---|
$id |
int | Handle ID to cancel and remove. |
Return Value:
True on success, false on failure.
private processMessages(): void
private timeToNext(): int