Method
PollerInterface::readable
Parks the current coroutine until poll() finds $stream readable.
Description#
public PollerInterface::readable(
mixed $stream,
float $timeout = PHP_FLOAT_MAX
): voidA stream closed while waited for is ready. If the wait is cancelled or times out, the stream
is no longer waited for when the exception leaves. One coroutine at a time waits to read a
stream: a second one gets a LogicException.
Parameters#
- $stream mixed
- $timeout float = PHP_FLOAT_MAX
Errors / Exceptions#
| Exception | When |
|---|---|
LogicException | If another coroutine is waiting to read $stream |
IOException | If polling fails for this stream |
TimeoutException | After $timeout seconds |