XAS::Supervisor::Client - The RPC interface to the Supervisor
use XAS::Supervisor::Client; my $rpc = XAS::Supervisor::Client->new() my $result = $rpc->start('sleeper');
This is the client module for RPC access to the XAS Supervisor.
This initilaize the module and can take these parameters. This module inherits from XAS::Lib::Net::Client and uses the same parameters.
Example: my $rpc = XAS::Supervisor::Client->new( -port => 9505, -host => 'localhost' };
This method will start a managed process. It takes one parameter, the name of the process, and returns "running" if successful.
Example: my $result = $rpc->start('sleeper');
This method will stop a managed process. It takes one parameter, the name of the process, and returns "stopped" if successful.
Example: my $result = $rpc->stop('sleeper');
This method will pause a managed process. It takes one parameter, the name of the process, and returns "paused" if successful.
Example: my $result = $rpc->pause('sleeper');
This method will resume a managed process. It takes one parameter, the name of the process, and returns "running" if successful.
Example: my $result = $rpc->resume('sleeper');
This method will kill a managed process. It takes one parameter, the name of the process, and returns "killed" if successful.
Example: my $result = $rpc->kill('sleeper');
This method will do a "stat" on a managed process. The process status will be from the OS level. It can be one of the following:
'unknown' 'other' 'ready' 'running' 'blocked' 'suspended blocked' 'suspended ready'
This method will list the known processes on the target supervisor.
Example: my $results = $rpc->list(); printf("Known processes\n"); foreach my $result (@$results) { printf('%s\n", $result); }
Kevin L. Esteb, <kevin@kesteb.us>
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.
To install XAS::Supervisor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XAS::Supervisor
CPAN shell
perl -MCPAN -e shell install XAS::Supervisor
For more information on module installation, please visit the detailed CPAN module installation guide.