Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
GuzzleHttp\Handler\Proxy Class Reference

Static Public Member Functions

static wrapStreaming (callable $default, callable $streaming)
 Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.
 
static wrapSync (callable $default, callable $sync)
 Sends synchronous requests to a specific handler while sending all other requests to another handler.
 

Member Function Documentation

◆ wrapStreaming()

static GuzzleHttp\Handler\Proxy::wrapStreaming ( callable $default,
callable $streaming )
static

Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.

This, for example, could be useful for taking advantage of the performance benefits of curl while still supporting true streaming through the StreamHandler.

Parameters
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface $default Handler used for non-streaming responses
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface $streaming Handler used for streaming responses
Return values
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface Returns the composed handler.

◆ wrapSync()

static GuzzleHttp\Handler\Proxy::wrapSync ( callable $default,
callable $sync )
static

Sends synchronous requests to a specific handler while sending all other requests to another handler.

Parameters
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface $default Handler used for normal responses
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface $sync Handler used for synchronous responses.
Return values
callable(\Psr\Http\Message\RequestInterface,array)GuzzleHttp\Promise\PromiseInterface Returns the composed handler.

The documentation for this class was generated from the following file: