phasync
PollerInterface / writable

Method

PollerInterface::writable

Parks the current coroutine until poll() finds $stream writable.

Description#

public PollerInterface::writable(
    mixed $stream,
    float $timeout = PHP_FLOAT_MAX
): void

Otherwise as readable(). One coroutine at a time waits to write to a stream; a reader may wait meanwhile.

Parameters#

$stream mixed
$timeout float = PHP_FLOAT_MAX

Errors / Exceptions#

ExceptionWhen
LogicExceptionIf another coroutine is waiting to write to $stream
IOExceptionIf polling fails for this stream
TimeoutExceptionAfter $timeout seconds