Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 22 lines (16 sloc) 0.447 kb
d204ea6 @rcaputo Document signal handler classes, and create an example from which to exc...
authored
1 # Watch signals a few different ways.
2
3 use warnings;
4 use strict;
5 use lib qw(../lib);
6
7 use Reflex::Signal;
8 use Reflex::Callbacks qw(cb_coderef);
9 use ExampleHelpers qw(eg_say);
10
11 eg_say("Process $$ is waiting for SIGUSR1 and SIGUSR2.");
12
13 my $usr1 = Reflex::Signal->new(
14 name => "USR1",
15 on_signal => cb_coderef { eg_say("Got SIGUSR1.") },
16 );
17
18 my $usr2 = Reflex::Signal->new( name => "USR2" );
5f9458c @rcaputo Rename observe() to watch(). Rename wait() to next().
authored
19 while ($usr2->next()) {
d204ea6 @rcaputo Document signal handler classes, and create an example from which to exc...
authored
20 eg_say("Got SIGUSR2.");
21 }
Something went wrong with that request. Please try again.