EV::Signal#
A signal watcher, as EV::signal makes: its callback runs when the process receives a signal. These methods change which signal; the methods all watchers share are EV::Watcher’s.
A signal can be watched by any number of watchers, but in one loop only: $w->start in a second loop croaks unable to start signal watcher, signal N already registered in another loop. While a watcher of a signal is active, EV holds the signal; Perl’s %SIG handler for it is not called.
Synopsis#
my $w = EV::signal 'TERM', sub { EV::break };
print $w->signal; # 15
$w->set('INT');
Functions#
Configuration#
set#
Watch another signal: $w->set('USR1'), a name or number as for kill. One that is no signal croaks illegal signal number or name.
signal#
The signal watched, always as a number; with an argument (name or number), watch that one instead and return the old number. The second names IOT, CLD and POLL are the signals ABRT, CHLD and IO (upstream mistakes them for nonexistent signals; covered by t/81-xs-native/EV/310-signal-alias.t).