NAME

Parallel::Forker::Process - Single parallel fork process object

SYNOPSIS

$obj->run;
$obj->poll;
$obj->kill(<"SIGNAL">);
$obj->kill_tree(<"SIGNAL">);

DESCRIPTION

Manage a single process under the control of Parallel::Forker.

Processes are created by calling a Parallel::Forker object's schedule method, and retrieved by various methods in that class.

Processes transition over 6 states. They begin in idle state, and are transitioned by the user into ready state. As their dependencies complete, Parallel::Forker transitions them to the runable state. As the max_proc limit permits, they transition to the running state, and executed. On completion, they transition to the done state. If a process depends on another process, and that other process fails, they transition to the parerr (parent error) state, and are never run.

METHODS

forkref

Return the parent Parallel::Forker object this process belongs to.

is_done

Returns true if the process is in the done state.

is_idle

Returns true if the process is in the idle state.

is_parerr

Returns true if the process is in the parent error state.

is_ready

Returns true if the process is in the ready state.

is_runable

Returns true if the process is in the runable state.

is_running

Returns true if the process is in the running state.

kill

Kill the process if it is running

kill (<signal>)

Send a kill to this child.

kill_tree

Kill the process and any of its subchildren.

kill_tree_all (<signal>)

Send a kill to this child and its subchildren.

name

Return the name of the process.

label

Return the label of the process, if any, else undef.

pid

Return the process ID if this job is running, else undef.

poll

Check the process for activity, invoking callbacks if needed. Generally Fork->poll() is used instead.

ready

Mark this process as being ready for execution when all run_after's are ready and CPU resources permit. When that occurs, run will be called on the process automatically.

run

Start this process now.

run_after

Add a new (or list of) processes that must be completed before this process can be runnable. You may pass a process object (from schedule), a process name, or a process label. You may use "|" or "&" in a string to run this process after a OR of any processes exit, or after ALL exit (the default.) ! in front of a process name indicates to run if that process fails with bad exit status. ^ in front of a process indicates to run if that process succeeds OR fails.

DISTRIBUTION

The latest version is available from CPAN and from http://www.veripool.com/.

Copyright 2002-2007 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either the GNU Lesser General Public License or the Perl Artistic License.

AUTHORS

Wilson Snyder <wsnyder@wsnyder.org>

SEE ALSO

Parallel::Forker