NAME

Linux::Event::Reactor::Backend::Epoll - epoll backend for Linux::Event::Reactor

SYNOPSIS

# Usually constructed internally by Linux::Event::Reactor.
my $backend = Linux::Event::Reactor::Backend::Epoll->new;

DESCRIPTION

Linux::Event::Reactor::Backend::Epoll is the built-in readiness backend for Linux::Event::Reactor. It translates the reactor bitmask into the event set expected by Linux::Epoll and translates native epoll notifications back into reactor masks.

CONSTRUCTOR

new(%args)

Recognized optional arguments:

  • edge

    Enable edge-triggered mode by default for all registrations.

  • oneshot

    Enable one-shot mode by default for all registrations.

METHODS

name

Returns epoll.

watch($fh, $mask, $cb, %opt)

Register a filehandle with epoll and install the standardized reactor callback. Returns the integer file descriptor.

modify($fh_or_fd, $mask, %opt)

Modify an existing epoll registration. If the underlying Linux::Epoll instance provides modify, it is used directly. Otherwise the backend falls back to delete plus add.

This path is especially important for EPOLLONESHOT rearm.

unwatch($fh_or_fd)

Remove an existing registration.

run_once($loop, $timeout_s = undef)

Call epoll wait once and dispatch readiness callbacks.

NOTES

This backend keeps a small registration table keyed by file descriptor so it can preserve callback, tag, and loop information across modify calls.

SEE ALSO

Linux::Event::Reactor, Linux::Event::Reactor::Backend, Linux::Epoll