NAME
IO::Async::SignalProxy
- a class to allow handling of POSIX signals with IO::Async
-based IO
SYNOPSIS
use IO::Async::SignalProxy;
my $sigproxy = IO::Async::SignalProxy->new(
signal_HUP => sub { reread_config() },
);
my $set = IO::Async::Set::...
$set->add( $sigproxy );
DESCRIPTION
This module provides a class that allows POSIX signals to be handled safely alongside other IO operations on filehandles in an IO::Async::Set
. Because signals could arrive at any time, care must be taken that they do not interrupt the normal flow of the program, and are handled at the same time as other events in the IO::Async::Set
's results.
CONSTRUCTOR
$proxy = IO::Async::SignalProxy->new( %params )
This function returns a new instance of a IO::Async::SignalProxy
object. The %params
hash takes keys that specify callback functions to run when signals arrive. They are all of the form
signal_$NAME => sub { ... }
where $NAME
is the basic POSIX name for the signal, such as TERM
or CHLD
.
SEE ALSO
POSIX for the
SIGname
constants
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>