Skip to content

Latest commit

 

History

History
358 lines (126 loc) · 2.91 KB

CurlMultiHandler.md

File metadata and controls

358 lines (126 loc) · 2.91 KB

CurlMultiHandler

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

Properties

factory

private \GuzzleHttp\Handler\CurlFactoryInterface $factory

selectTimeout

private int $selectTimeout

active

private int $active

handles

private array $handles

See Also:

  • \GuzzleHttp\Handler\CurlMultiHandler::addRequest -

delays

private array<int,float> $delays

See Also:

  • \GuzzleHttp\Handler\CurlMultiHandler::addRequest -

options

private array $options

Methods

__construct

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

__get

public __get(string $name): resource|\CurlMultiHandle

Parameters:

Parameter Type Description
$name string

__destruct

public __destruct(): mixed

__invoke

public __invoke(\Psr\Http\Message\RequestInterface $request, array $options): \GuzzleHttp\Promise\PromiseInterface

Parameters:

Parameter Type Description
$request \Psr\Http\Message\RequestInterface
$options array

tick

Ticks the curl event loop.

public tick(): void

execute

Runs until all outstanding connections have completed.

public execute(): void

addRequest

private addRequest(array $entry): void

Parameters:

Parameter Type Description
$entry array

cancel

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.


processMessages

private processMessages(): void

timeToNext

private timeToNext(): int