NAME
Reflex::PID - Observe the exit of a subprocess, via handling SIGCHLD.
VERSION
version 0.004
SYNOPSIS
# Not a complete program. Please see the source for # Reflex::POE::Wheel::Run for one example.
use Reflex::PID;
has sigchild_watcher => (
isa => 'Reflex::PID|Undef',
is => 'rw',
traits => ['Reflex::Trait::Observer'],
role => 'sigchld',
);
sub some_method {
my $self = shift;
my $pid = fork();
die $! unless defined $pid;
exec("some-program.pl") unless $pid;
# Parent here.
$self->sigchild_watcher(
Reflex::PID->new(pid => $pid)
);
}
sub on_sigchld_signal {
# Handle the event.
}
DESCRIPTION
Reflex::PID waits for a child process to exit, then announces the fact by emitting a "signal" event.
TODO - Complete the documentation, including the parameters of the signal event.
GETTING HELP
ACKNOWLEDGEMENTS
SEE ALSO
Reflex and "SEE ALSO" in Reflex
BUGS
CORE AUTHORS
OTHER CONTRIBUTORS
"OTHER CONTRIBUTORS" in Reflex