ok,.. more tests and stuff
[gitmo/MooseX-Daemonize.git] / lib / MooseX / Daemonize / WithSignalHandling.pm
CommitLineData
ba19d02e 1package MooseX::Daemonize::WithSignalHandling;
18cc5c89 2use strict; # because Kwalitee is pedantic
3use Moose::Role;
4
5our $VERSION = 0.01;
6
7# NOTE:
8# this would be an excellent canidate for
9# a parameterized role, since we would want
10# to have the ability to specify which
11# signals we want handled
12
13requires 'handle_signal';
14
15sub setup_signals {
16 my $self = shift;
17 foreach my $signal (qw[ INT HUP ]) {
18 $SIG{$signal} = sub { $self->handle_signal($signal) };
19 }
20}
21
221;
23
24__END__
25
26=pod
27
28=cut