Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 447 Bytes
# Watch signals a few different ways.
use warnings;
use strict;
use lib qw(../lib);
use Reflex::Signal;
use Reflex::Callbacks qw(cb_coderef);
use ExampleHelpers qw(eg_say);
eg_say("Process $$ is waiting for SIGUSR1 and SIGUSR2.");
my $usr1 = Reflex::Signal->new(
name => "USR1",
on_signal => cb_coderef { eg_say("Got SIGUSR1.") },
my $usr2 = Reflex::Signal->new( name => "USR2" );
while ($usr2->wait()) {
eg_say("Got SIGUSR2.");
Jump to Line
Something went wrong with that request. Please try again.