Documentation

ByteStream

Table of Contents

Namespaces

Base64
Compression

Interfaces

ReadableStream
A `ReadableStream` allows reading byte streams in chunks.
ResourceStream
WritableStream
A `WritableStream` allows writing data in chunks. Writers can wait on the returned promises to feel the backpressure.

Classes

AsyncWriter
This class provides a tool for efficiently writing to a stream asynchronously. A single fiber is used for all writes to the stream, while each write returns a {@see Future} instead of waiting for each write to complete before returning control to the caller.
BufferedReader
BufferException
ClosedException
Payload
Creates a buffered message from a ReadableStream.
PendingReadError
Thrown in case a second read operation is attempted while another read operation is still pending.
Pipe
Create a local stream where data written to the pipe is immediately available on the pipe.
ReadableBuffer
ReadableStream with a single already known data chunk.
ReadableIterableStream
Creates a stream from an iterable emitting strings. If the iterable throws an exception, the exception will be thrown from {@see read()} and {@see buffer()}. Consider wrapping any exceptions in {@see StreamException} if you do not wish for another type of exception to be thrown from the stream.
ReadableResourceStream
Readable stream abstraction for PHP's stream resources.
ReadableStreamChain
StreamChannel
An asynchronous channel for sending data between threads and processes.
StreamException
WritableBuffer
WritableIterableStream
WritableResourceStream
Output stream abstraction for PHP's stream resources.

Traits

ReadableStreamIteratorAggregate

Functions

pipe()  : int
buffer()  : string
getInputBufferStream()  : ReadableResourceStream
The php://input buffer stream for the process associated with the currently active event loop.
getOutputBufferStream()  : WritableResourceStream
The php://output buffer stream for the process associated with the currently active event loop.
getStdin()  : ReadableResourceStream
The STDIN stream for the process associated with the currently active event loop.
getStdout()  : WritableResourceStream
The STDOUT stream for the process associated with the currently active event loop.
getStderr()  : WritableResourceStream
The STDERR stream for the process associated with the currently active event loop.
split()  : Traversable<int, string>
Splits the stream into chunks based on a delimiter.
splitLines()  : Traversable<int, string>
Splits the stream into lines.
parseLineDelimitedJson()  : Traversable<int, mixed>

Functions

split()

Splits the stream into chunks based on a delimiter.

split(ReadableStream $source, non-empty-string $delimiter[, Cancellation|null $cancellation = null ]) : Traversable<int, string>
Parameters
$source : ReadableStream
$delimiter : non-empty-string
$cancellation : Cancellation|null = null
Return values
Traversable<int, string>

parseLineDelimitedJson()

parseLineDelimitedJson(ReadableStream $source[, bool $associative = false ][, int<1, 2147483647> $depth = 512 ][, int $flags = 0 ][, Cancellation|null $cancellation = null ]) : Traversable<int, mixed>
Parameters
$source : ReadableStream
$associative : bool = false
$depth : int<1, 2147483647> = 512
$flags : int = 0
$cancellation : Cancellation|null = null
Tags
throws
JsonException

If JSON parsing fails

Return values
Traversable<int, mixed>

Traversable of decoded JSON values


        
On this page

Search results