NAME
Hypersonic::Event::Epoll - epoll event backend for Linux
SYNOPSIS
use Hypersonic::Event;
my $backend = Hypersonic::Event->backend('epoll');
# $backend is 'Hypersonic::Event::Epoll'
DESCRIPTION
Hypersonic::Event::Epoll is the epoll-based event backend for Hypersonic. It uses edge-triggered mode (EPOLLET) for maximum performance.
epoll is the recommended backend for Linux systems. It provides O(1) event notification for any number of file descriptors.
METHODS
name
my $name = Hypersonic::Event::Epoll->name; # 'epoll'
Returns the backend name.
available
if (Hypersonic::Event::Epoll->available) { ... }
Returns true if this backend is available (Linux only).
includes
Returns the C #include directives needed for epoll.
defines
Returns the C #define directives for epoll configuration.
event_struct
my $struct = Hypersonic::Event::Epoll->event_struct; # 'epoll_event'
Returns the C struct name used for the events array.
gen_create($builder, $listen_fd_var)
Generates C code to create an epoll instance and register the listen socket.
gen_add($builder, $loop_var, $fd_var)
Generates C code to add a file descriptor to the epoll instance.
gen_del($builder, $loop_var, $fd_var)
Generates C code to remove a file descriptor from the epoll instance.
gen_wait($builder, $loop_var, $events_var, $count_var, $timeout_var)
Generates C code to wait for events with a timeout.
gen_get_fd($builder, $events_var, $index_var, $fd_var)
Generates C code to extract the file descriptor from an event.
AVAILABILITY
Linux only. For BSD/macOS, use Hypersonic::Event::Kqueue.
SEE ALSO
Hypersonic::Event, Hypersonic::Event::Role, Hypersonic::Event::Kqueue
AUTHOR
LNATION <email@lnation.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.