NAME
IO::AsyncX::EventFD - simple eventfd notifications
SYNOPSIS
#!/usr/bin/env perl
use
strict;
use
warnings;
use
IO::Async::Loop;
use
IO::AsyncX::EventFD;
my
$loop
= IO::Async::Loop->new;
$loop
->add(
my
$eventfd
= IO::AsyncX::EventFD->new(
notify
=>
sub
{
warn
"Had event\n"
}));
$loop
->loop_once(0.001);
warn
"Notifying...\n"
;
$eventfd
->notify;
$loop
->loop_once(0.001);
DESCRIPTION
Provides a very thin layer over Linux::FD::Event.
METHODS
notify
Sends a notification to the event FD. This consists of a call to "add" in Linux::FD::Event with the value 1.
eventfd
Returns the Linux::FD::Event handle.
configure
Configuration. Currently supports the following named parameters:
notify - the callback which will be triggered when there's a new semaphore value
METHODS - Internal
_add_to_loop
Called when we are added to the loop.
on_read_ready
Called when there's a read event.
handle
Returns the underlying IO::Async::Handle instance.
SEE ALSO
Database::Async::SQLite - uses eventfd as a notification mechanism from the sqlite thread
AUTHOR
Tom Molesworth <TEAM@cpan.org>
LICENSE
Copyright Tom Molesworth 2015-2016. Licensed under the same terms as Perl itself.