Proxy
in package
Provides basic proxies for handlers.
Table of Contents
- wrapStreaming() : callable
- Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.
- wrapSync() : callable
- Sends synchronous requests to a specific handler while sending all other requests to another handler.
Methods
wrapStreaming()
Sends streaming requests to a streaming compatible handler while sending all other requests to a default handler.
public
static wrapStreaming(callable $default, callable $streaming) : callable
This, for example, could be useful for taking advantage of the performance benefits of curl while still supporting true streaming through the StreamHandler.
Parameters
- $default : callable
-
Handler used for non-streaming responses
- $streaming : callable
-
Handler used for streaming responses
Return values
callable —Returns the composed handler.
wrapSync()
Sends synchronous requests to a specific handler while sending all other requests to another handler.
public
static wrapSync(callable $default, callable $sync) : callable
Parameters
- $default : callable
-
Handler used for normal responses
- $sync : callable
-
Handler used for synchronous responses.
Return values
callable —Returns the composed handler.