Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (15 sloc) 0.429 kb
344d969e »
2010-09-04 Deliver PID exit noficiations only to interested objects.
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 ExampleHelpers qw(eg_say);
9
10 eg_say("Process $$ is waiting for SIGUSR1 twice.");
11
12 my $usr1_a = Reflex::Signal->new(
13 signal => "USR1",
14 on_signal => sub { eg_say("Got SIGUSR1 callback.") },
15 );
16
17 my $usr1_b = Reflex::Signal->new( signal => "USR1" );
18 while ($usr1_b->next()) {
19 eg_say("Got SIGUSR1 from promise.");
20 }
Something went wrong with that request. Please try again.