phasync
BufferedStream / read

Method

BufferedStream::read

Returns up to $length bytes, waiting while the content is not yet appended and the stream has not ended.

Description#

public BufferedStream::read(
    $length
): string

Parameters#

$length

Return values#

string

Errors / Exceptions#

ExceptionWhen
TimeoutExceptionWhen nothing is appended and end() is not called within $deadlockTimeout seconds
RuntimeExceptionWhen the stream is detached or closed