Inheritance diagram for Reactor:Selects and calls reactive sockets when they are readable.
Protected Properties | |
| ReactiveInterface[] | $sockets = [] |
| All sockets in the reactor, keyed by ID. More... | |
Public Static Methods | |
| static int | select (array &$read, array &$write, array &$except, ?float $timeout=null) |
| Selects instances. More... | |
Public Methods | |
| $this | add (ReactiveInterface $socket) |
| Adds a reactive socket for selection. More... | |
| int | count () |
| The number of reactive sockets in the reactor. More... | |
| ReactiveInterface[] | getSockets () |
| bool | has (ReactiveInterface $socket) |
| Whether a socket is in the reactor. More... | |
| int | react (?float $timeout=null) |
| Selects the reactor's sockets and calls their reactive methods. More... | |
| $this | remove (ReactiveInterface $socket) |
| Removes a socket from the reactor. More... | |
Protected Methods | |
| void | onError (int $channel, $socket, Throwable $error) |
|
protected |
All sockets in the reactor, keyed by ID.
| $this add | ( | ReactiveInterface | $socket | ) |
| int count | ( | ) |
The number of reactive sockets in the reactor.
| ReactiveInterface [] getSockets | ( | ) |
| bool has | ( | ReactiveInterface | $socket | ) |
|
protected |
| int | $channel | |
| ReactiveInterface | $socket | |
| Throwable | $error |
| int react | ( | ?float | $timeout = null | ) |
Selects the reactor's sockets and calls their reactive methods.
Invoke this in a loop that checks Reactor::count() a condition.
Closed sockets are automatically removed from the reactor.
| float | null | $timeout | Maximum seconds to block. NULL blocks forever. |
| $this remove | ( | ReactiveInterface | $socket | ) |
|
static |
Selects instances.
Can be used to select non-reactive sockets.
| SocketInterface[] | $read | |
| SocketInterface[] | $write | |
| SocketInterface[] | $except | |
| float | null | $timeout | Maximum seconds to block. NULL blocks forever. |
| SocketError |