XAS::Lib::Spawn - A class to spawn detached processes within the XAS environment
use XAS::Lib::Spawn; my $process = XAS::Lib::Spawn->new( -command => 'perl test.pl' ); $process->run();
This class spawns a process to run in the back ground in a platform independent way. Mixins are loaded to handle the differences between Unix/Linux and Windows.
This method initialized the module and takes the following parameters:
The command to run.
The optional directory to start the process in. Defaults to the current directory of the parent process.
Optional, addtional environmnet variables to provide to the process. The default is none.
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.
Start the process. It returns the pid of that process.
Returns the status of the process. The status could be one of the follow:
Pause the process, returns 1 on success.
Resume the process, returns 1 on success.
Stop the process, returns 1 on success.
Kill the process, returns 1 on success.
Waits for the process to finish, returns 0 when the process is done. This method may return a -1 if the processes was reaped before the wait is called.
Returns the exit code of the process, or a -1 if the exit code is not available.
Kevin L. Esteb, <kevin@kesteb.us>
Copyright (c) 2012-2016 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.
To install XAS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAS
CPAN shell
perl -MCPAN -e shell install XAS
For more information on module installation, please visit the detailed CPAN module installation guide.