Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 21 lines (16 sloc) 0.449 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 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(
signal => "USR1",
on_signal => cb_coderef { eg_say("Got SIGUSR1.") },
);

my $usr2 = Reflex::Signal->new( signal => "USR2" );
while ($usr2->next()) {
eg_say("Got SIGUSR2.");
}
Something went wrong with that request. Please try again.