The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Reflex::Signal - Generic signal observer and base class for specific ones.

VERSION

version 0.010

SYNOPSIS

As a callback:

        use Reflex::Signal;
        use Reflex::Callbacks qw(cb_coderef);

        my $usr1 = Reflex::Signal->new(
                name      => "USR1",
                on_signal => cb_coderef { print "Got SIGUSR1.\n" },
        );

As a promise:

        my $usr2 = Reflex::Signal->new( name => "USR2" );
        while ($usr2->wait()) {
                print "Got SIGUSR2.\n";
        }

May also be used with observers, and Reflex::Trait::Observer, but those use cases aren't shown here.

DESCRIPTION

Reflex::Signal is a general signal observer. It may be used to notify programs when they are sent a signal via kill.

Public Attributes

name

"name" defines the name (or number) of an interesting signal. The Reflex::Signal object will emit events when it detects that the process has been given that signal.

Public Methods

None at this time. Destroy the object to stop it.

Public Events

Reflex::Signal and its subclasses emit just one event: "signal". Generic signals have no additional information, but specific ones may. For example, Reflex::PID (SIGCHLD) includes a process ID and information about its exit.

SEE ALSO

Moose::Manual::Concepts

Reflex Reflex::PID Reflex::POE::Wheel::Run

"ACKNOWLEDGEMENTS" in Reflex "ASSISTANCE" in Reflex "AUTHORS" in Reflex "BUGS" in Reflex "BUGS" in Reflex "CONTRIBUTORS" in Reflex "COPYRIGHT" in Reflex "LICENSE" in Reflex "TODO" in Reflex