NAME
Linux::Event - Linux-native readiness event loop for Perl
SYNOPSIS
use v5.36;
use Linux::Event;
my $loop = Linux::Event->new;
$loop->after(0.250, sub ($loop) {
say "timer fired";
$loop->stop;
});
$loop->run;
DESCRIPTION
Linux::Event is the front door for a Linux-native readiness event loop. It currently ships with an epoll backend and uses Linux kernel primitives: timerfd, signalfd, eventfd, and pidfd.
This distribution intentionally stays at the loop-and-primitives layer. Higher level socket, stream, and process helpers live in companion distributions. Additional readiness backends may be added in future releases.
CONSTRUCTOR
new(%args)
Create a new loop. With no arguments, the default epoll backend is used:
my $loop = Linux::Event->new;
You may pass backend => 'epoll' explicitly or provide a custom readiness backend object:
my $loop = Linux::Event->new(backend => 'epoll');
The old model selector has been removed. Passing model is an error.
CORE MODULES
-
Public readiness loop.
-
Readiness backend contract.
-
Built-in epoll backend.
-
Mutable watcher handle returned by
watch()registrations. -
signalfd adaptor.
-
eventfd-backed wakeup primitive.
-
pidfd-backed process-exit notifications.
-
Internal monotonic deadline queue.
ECOSYSTEM LAYERING
Companion distributions provide higher-level building blocks:
-
Server-side socket acquisition.
-
Client-side nonblocking outbound connect.
-
Buffered I/O and backpressure management for an established filehandle.
-
Asynchronous child-process helpers built on the loop.
-
Monotonic clock helpers used by the core loop and related modules.
-
timerfd wrapper used by the core loop.
AUTHOR
Joshua S. Day
LICENSE
Same terms as Perl itself.