NAME

Process::SubProcess - Library to manage Sub Processes as Objects

DESCRIPTION

Process::SubProcess implements a Class to manage a Sub Process and read its Output and Errors

The Idea of this API is to launch Sub Processes and keep track of all Output on STDOUT, STDERR, the EXIT CODE and possible System Errors at Launch Time in an object oriented manner. This allows an easy aggregation and thus the creation of Sub Process Groups and Sub Process Pools for simultaneous execution of multiple Sub Processes while keeping the execution logs separated.

STATIC METHODS

runSubProcess ( [ COMMAND | OPTIONS ] )

This creates adhoc an Process::SubProcess Object and runs the command given as string.

COMMAND a single scalar parameter will be interpreted as command to execute without any additional options.

OPTIONS are passed in a hash like fashion, using key and value pairs. Combining the command with additional OPTIONS also requires the COMMAND to be part of the hash.

CONSTRUCTOR

new ( [ CONFIGURATIONS ] )

This is the constructor for a new SubProcess.

CONFIGURATIONS are passed in a hash like fashion, using key and value pairs.

Administration Methods

setArrProcess ( CONFIGURATIONS )

This Method will asign Values to physically Data Fields.

CONFIGURATIONS is a list are passed in a hash like fashion, using key and value pairs.

Recognized Configurations:

command - The command that has to be executed. It only can be set if the process is not running yet

timeout - Time in seconds to wait for the process to finish. After this time the process will be terminated

check | read | readtimeout - Time in seconds to wait for the process output. If the process is expected to run longer it is useful to set it to avoid excessive checks. It is also important for multiple process execusions, because other processes will not be checked before the read has not timed out.

set ( CONFIGURATIONS )

Shorthand for setArrProcess()

See "Method setArrProcess()"

setName ( NAME )

This Method will asign a Name to the process.

NAME is a string that will be assigned as the process name. This is useful when there are several processes with the same command running and a more prettier readable name is desired.