NAME

Mojo::IOLoop::ReadWriteFork::SIGCHLD - Non-blocking waitpid for Mojolicious

DESCRIPTION

Mojo::IOLoop::ReadWriteFork::SIGCHLD is a module that can wait for a child process to exit. This is currently done either with "child" in EV or a recurring timer and waitpid.

ATTRIBUTES

$hash_ref = $sigchld->pids;

Returns a hash ref where the keys are active child process IDs and the values are array-refs of callbacks passed on to "waitpid".

METHODS

is_waiting

$bool = $sigchld->is_waiting;

Returns true if $sigchld is still has a recurring timer or waiting for a process to exit.

singleton

$sigchld = Mojo::IOLoop::ReadWriteFork::SIGCHLD->singleton;

Returns a shared Mojo::IOLoop::ReadWriteFork::SIGCHLD object.

waitpid

$sigchld->waitpid($pid, sub { my ($exit_value) = @_ });

Will call the provided callback with $? when the $pid is no longer running.

SEE ALSO

Mojo::IOLoop::ReadWriteFork.