instantiation. Takes a hashref as an argument. Recognized attributes are as follows.
number of worker processes (default: 10)
interval in seconds between spawning child processes unless a child process exits abnormally (default: 0)
number of seconds to deter spawning of child processes after a worker exits abnormally (default: 1)
hashref of signals to be trapped. Manager process will trap the signals listed in the keys of the hash, and send the signal specified in the associated value (if any) to all worker processes. If the associated value is a scalar then it is treated as the name of the signal to be sent immediately to all the worker processes. If the value is an arrayref the first value is treated the name of the signal and the second value is treated as the interval (in seconds) between sending the signal to each worker process.
coderef that is called when a child is reaped. Receives the instance to
the current Parallel::Prefork, the childs pid, and its exit status.
coderefs that are called in the manager process before and after fork, if being set
The main routine. There are two ways to use the function.
If given a subref as an argument, forks child processes and executes that subref within the child processes. The processes will exit with 0 status when the subref returns.
The other way is to not give any arguments to the function. The function returns undef in child processes. Caller should execute the application logic and then call finish to terminate the process.
The start function returns true within manager process upon receiving a signal specified in the trap_signals hashref.