XAS::Lib::Process - A class for managing processes within the XAS environment
use XAS::Lib::Process; my $process = XAS::Lib::Process->new( -command => 'perl test.pl' ); $process->run();
This class manages a sub process in a platform independent way. Mixins are loaded to handle the differences between Unix/Linux and Windows. This module inherits from XAS::Lib::POE::Service. Please refer to that module for additional help.
This method initialized the module and takes the following parameters:
This indicates wither to auto start the process. The default is true.
This indicates wither to auto restart the process if it exits. The default is true.
The command to run.
The optional directory to start the process in. Defaults to the current directory of the parent process.
Optional, additional environment variables to provide to the process. The default is none.
Optional exit codes to check for the process. They default to '0,1'. If the exit code matches, then the process is auto restarted. This should be a comma delimited list of values.
The optional number of retries for restarting the process. The default is 5.
The group to run the process under. Defaults to 'nobody'. This group may not be defined on your system. This option is not implemented on Windows.
The optional priority to run the process at. Defaults to 0. This option is not implemented on Windows.
The optional protection mask for the process. Defaults to '0022'. This option is not implemented on Windows.
The optional user to run the process under. Defaults to 'nobody'. This user may not be defined on your system. This option is not implemented on Windows.
This option is used to indicate wither to redirect stdout and stderr from the child process to the parent and stdin from the parent to the child process. The redirection combines stderr with stdout. Redirection is implemented using sockets. This may cause buffering problems with the child process.
The default is no.
The optional number of seconds to delay a retry on an auto restart process. The default is 0, or no delay in restarting the process.
The optional input driver to use. Defaults to POE::Driver::SysRW.
The optional output driver to use. Defaults to POE::Driver::SysRW.
The optional filter to use for input. Defaults to POE::Filter::Line.
The optional output filter to use. Defaults to POE::Filter::Line.
This is an optional coderef to handle output from the process. The coderef takes one parameter, the output from the process.
This method will write a buffer to stdin.
Kevin L. Esteb, <email@example.com>
Copyright (c) 2012-2015 Kevin L. Esteb
This is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0. For details, see the full text of the license at http://www.perlfoundation.org/artistic_license_2_0.