Menu

Reference / Io\Poll

Backend

enum
enum Backend

An I/O readiness mechanism for a {@see Context}.

Auto chooses the platform's reactor: epoll on Linux, kqueue on Darwin and BSD. Poll (poll(2)) is available everywhere. EventPorts and WSAPoll are never available in this implementation.

Cases

AutoPick the best backend for the platform.
Pollpoll(2); level-triggered only, always available.
EpollLinux epoll; available on Linux only.
Kqueuekqueue; available on Darwin and BSD.
EventPortsSolaris event ports; not supported.
WSAPollWindows WSAPoll; not supported.

Methods

isAvailable()Whether this backend can be used on the current platform.
supportsEdgeTriggering()Whether the backend supports {@see Event::EdgeTriggered}.
getAvailableBackends()Lists the concrete backends usable on this host.

isAvailable()#source

function isAvailable(): bool

Whether this backend can be used on the current platform.

Returns

bool — true if a {@see Context} can be created with it

supportsEdgeTriggering()#source

function supportsEdgeTriggering(): bool

Whether the backend supports {@see Event::EdgeTriggered}.

Returns

bool — true for Epoll and Kqueue, false for Poll

getAvailableBackends()#source

static function getAvailableBackends(): array

Lists the concrete backends usable on this host.

Poll is always first; Auto is never included.

Returns

Backend[] — the concrete (non-Auto) backends available on this host

View source