The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XAS::Supervisor::Client - The RPC interface to the Supervisor

SYNOPSIS

 use XAS::Supervisor::Client;

 my $rpc = XAS::Supervisor::Client->new()
 my $result = $rpc->start('sleeper');

DESCRIPTION

This is the client module for RPC access to the XAS Supervisor.

METHODS

new

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'
     };

start($name)

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');

stop($name)

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');

pause($name)

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');

resume($name)

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');

kill($name)

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');

status($name)

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'

list

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);

     }

SEE ALSO

XAS::Supervisor::Controller
XAS::Supervisor::Monitor
XAS::Supervisor
XAS

AUTHOR

Kevin L. Esteb, <kevin@kesteb.us>

COPYRIGHT AND LICENSE

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.