NAME
Supervisor::RPC::Server - A RPC interface to the Superviors environment
SYNOPSIS
my $supervisor = Supervisor::Controller->new(
Name => 'supervisor',
Logfile => '/dev/stdout',
Processes => Supervisor::ProcessFactory->load(
Config => 'supervisor.ini',
Supervisor => 'suprvisor',
),
RPC => Supervisor::RPC::Server->new(
Name => 'rpc',
Port => 9505,
Address => 127.0.0.1,
Logfile => '/dev/stdout'
Supervisor => 'supervisor',
)
);
$supervisor->run;
DESCRIPTION
This module allows the supervisor environment to interface with external agents. This is done thru a limited RPC interface. The RPC format is based on JSON-RPC v2.0.
METHODS
- new
-
This initializes the module and starts listening for requests. There are five parameters that can be passed. They are the following:
Name - the name of the RPC session. Port - the IP port to listen on (default 9505) Address - the address to bind to (default 127.0.0.1) Logfile - the logfile to use Supervisor - the name of the Controller session.
RPC Functions
- stop_process
-
This method takes the passed process name, creates a data structure and triggers the "stop_process" event in the supervisors context. When the process is stopped, a message is sent back to the client.
- start_process
-
This method takes the passed process name, creates a data structure and triggers the "start_process" event in the supervisors context. When the process is started, a message is sent back to the client.
- stat_process
-
This method takes the passed process name, creates a data structure and triggers the "stat_process" event in the supervisors context. The status of the process is sent back to the client.
- reload_process
-
This method takes the passed process name, creates a data structure and triggers the "reload_process" event in the supervisors context. When done, a message is sent back to the client.
SEE ALSO
Supervisor
Supervisor::Base
Supervisor::Class
Supervisor::Constants
Supervisor::Controller
Supervisor::Log
Supervisor::Process
Supervisor::ProcessFactory
Supervisor::Session
Supervisor::Utils
Supervisor::RPC::Server
Supervisor::RPC::Client
AUTHOR
Kevin L. Esteb, <kesteb@wsipc.org>
COPYRIGHT AND LICENSE
Copyright (C) 2009 by Kevin L. Esteb
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.