CurlStreamingBody
class CurlStreamingBody implements StreamInterface
| internal |
Drive one transfer from the response consumer, including across coroutine handoff.
Constants
| DEFAULT_READ_TIMEOUT |
|
Properties
| protected bool | $attached | ||
| protected bool | $completed | ||
| protected bool | $closed | ||
| protected bool | $exposed | ||
| protected bool | $timedOut | ||
| protected int | $position | ||
| protected string | $pending | ||
| protected int | $pendingOffset | ||
| protected ResponseInterface|null | $completedResponse | ||
| protected TransferStats|null | $completedStats | ||
| protected null|list<array<string, list<string>>|RequestInterface|ResponseInterface> | $pendingTrailerArguments | ||
| protected RequestInterface | $request |
Methods
Take ownership of a configured transfer and its bounded receive buffer.
Receive the final headers and expose a caller-owned streaming body.
Create a transport failure that retains the received response.
Read available bytes without waiting to fill the requested length.
Drive native I/O and settle a completed transfer once.
Wait for network progress within the current phase's deadline.
Report streaming statistics once, at the handler-return boundary.
Remove the active handle before returning its native connection cache.
Close the stream and settle its transfer without waiting for more data.
Detach the body, which has no PHP stream resource to return.
Get the unknown size of the incremental response body.
Get the number of bytes consumed by the caller.
Determine whether the completed body has been consumed.
Determine whether the stream can seek.
Reject seeking on an incremental response.
Reject rewinding an incremental response.
Determine whether the response accepts writes.
Reject writes to the response body.
Determine whether the stream is open for reading.
Read the remaining response body.
Get metadata for the forward-only response stream.
Read the remaining response body as a string.
Release a response abandoned by its consumer.
Details
at line 67
__construct(CurlStreamingHandler $handler, CurlFactoryInterface $factory, CurlStreamingConnection|null $connection, EasyHandle|null $easy, BufferStream $buffer, bool $paused, array $options, float $startedAt, float|null $headerDeadline, float $readTimeout)
Take ownership of a configured transfer and its bounded receive buffer.
at line 85
ResponseInterface
response()
Receive the final headers and expose a caller-owned streaming body.
at line 181
protected ResponseException
responseException(string $message, ResponseInterface $response, Throwable|null $previous = null, bool $timeout = false)
Create a transport failure that retains the received response.
at line 191
string
read(int $length)
Read available bytes without waiting to fill the requested length.
at line 261
protected void
advance()
Drive native I/O and settle a completed transfer once.
at line 352
protected void
wait(float|null $idleDeadline, bool $headers = false)
Wait for network progress within the current phase's deadline.
at line 390
protected void
reportStats(ResponseInterface|null $response, Throwable|null $error = null)
Report streaming statistics once, at the handler-return boundary.
at line 420
protected void
detachTransfer()
Remove the active handle before returning its native connection cache.
at line 443
void
close()
Close the stream and settle its transfer without waiting for more data.
at line 473
mixed
detach()
Detach the body, which has no PHP stream resource to return.
at line 483
int|null
getSize()
Get the unknown size of the incremental response body.
at line 491
int
tell()
Get the number of bytes consumed by the caller.
at line 499
bool
eof()
Determine whether the completed body has been consumed.
at line 507
bool
isSeekable()
Determine whether the stream can seek.
at line 515
void
seek(int $offset, int $whence = SEEK_SET)
Reject seeking on an incremental response.
at line 524
void
rewind()
Reject rewinding an incremental response.
at line 533
bool
isWritable()
Determine whether the response accepts writes.
at line 541
int
write(string $string)
Reject writes to the response body.
at line 550
bool
isReadable()
Determine whether the stream is open for reading.
at line 558
string
getContents()
Read the remaining response body.
at line 572
mixed
getMetadata(string|null $key = null)
Get metadata for the forward-only response stream.
at line 582
string
__toString()
Read the remaining response body as a string.
at line 590
__destruct()
Release a response abandoned by its consumer.