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

"GETTING HELP" in Reflex

ACKNOWLEDGEMENTS

"ACKNOWLEDGEMENTS" in Reflex

SEE ALSO

Reflex and "SEE ALSO" in Reflex

BUGS

"BUGS" in Reflex

CORE AUTHORS

"CORE AUTHORS" in Reflex

OTHER CONTRIBUTORS

"OTHER CONTRIBUTORS" in Reflex

COPYRIGHT AND LICENSE

"COPYRIGHT AND LICENSE" in Reflex