phasync
StringBuffer / writeToResource

Method

StringBuffer::writeToResource

Starts a coroutine that writes the buffer to the stream until the buffer has ended and been read.

Description#

public StringBuffer::writeToResource(
    $resource
): Fiber

With several streams on one buffer, there is no control over which data goes where.

Parameters#

$resource
A stream to write to

Return values#

The coroutine; its result is the number of bytes written Fiber

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionIf $resource is not a stream

See also#