class CurlStreamingHandler

internal  
 

Deliver streaming responses without sharing an active cURL multi handle.

Constants

MAX_IDLE_CONNECTIONS

Properties

protected CurlFactoryInterface $factory
protected CurlStreamingConnection> $idleConnections

Methods

__construct(array $options = [], int $maxIdleConnections = 0)

Create a streaming handler with optional named-connection retention.

static Closure
wrap(callable $fallback, array $options = [], int $maxIdleConnections = 0)

Add coroutine streaming while retaining the caller's fallback handler.

static bool
supports(array $options)

Determine whether the current execution can use native streaming.

PromiseInterface
__invoke(RequestInterface $request, array $options)

Start a transfer and return its response without draining its body.

acquire(EasyHandle $easy)

Obtain an exclusive transport for the request's route without sharing another proxy's tunnel.

void
release(CurlStreamingConnection $connection)

Retain an idle transport after its request has been detached.

float
timeout(mixed $value, string $name)

Normalize a nonnegative request timeout in seconds.

Details

at line 46
__construct(array $options = [], int $maxIdleConnections = 0)

Create a streaming handler with optional named-connection retention.

Parameters

array $options
int $maxIdleConnections

at line 59
static Closure wrap(callable $fallback, array $options = [], int $maxIdleConnections = 0)

Add coroutine streaming while retaining the caller's fallback handler.

Parameters

callable $fallback
array $options
int $maxIdleConnections

Return Value

Closure

at line 77
static bool supports(array $options)

Determine whether the current execution can use native streaming.

Parameters

array $options

Return Value

bool

at line 91
PromiseInterface __invoke(RequestInterface $request, array $options)

Start a transfer and return its response without draining its body.

Parameters

RequestInterface $request
array $options

Return Value

PromiseInterface

at line 173
protected CurlStreamingConnection acquire(EasyHandle $easy)

Obtain an exclusive transport for the request's route without sharing another proxy's tunnel.

Parameters

EasyHandle $easy

Return Value

CurlStreamingConnection

at line 197
void release(CurlStreamingConnection $connection)

Retain an idle transport after its request has been detached.

Parameters

CurlStreamingConnection $connection

Return Value

void

at line 213
protected float timeout(mixed $value, string $name)

Normalize a nonnegative request timeout in seconds.

Parameters

mixed $value
string $name

Return Value

float