NAME
Plack::App::Gearman::Status - Plack application to display the status of Gearman job servers
VERSION
version 0.001000
SYNOPSIS
In a .psgi
file:
use Plack::App::Gearman::Status;
my $app = Plack::App::Gearman::Status->new({
job_servers => ['127.0.0.1:4730'],
});
As one-liner on the command line:
plackup -MPlack::App::Gearman::Status \
-e 'Plack::App::Gearman::Status->new({ job_servers => ["127.0.0.1:4730"] })->to_app'
DESCRIPTION
Plack::App::Gearman::Status displays the status of the configured Gearman job servers by fetching it using Net::Telnet::Gearman and turning it into a simple HTML page. This page contains information about the available workers and the status of the registered functions.
new
Constructor, creates new Plack::App::Gearman::Status instance.
Parameters
This method expects its parameters as a hash reference.
- job_servers
-
Array reference with the addresses of the job servers the application should connect to.
parse_job_server_address
Parses a job server address of the form hostname:port
with optional port
. If no port is given, it defaults to 4730
.
Parameters
This method expects positional parameters.
- address
-
The address to parse.
Result
A list with host and port.
connection
Connects to the given job server and returns the Net::Telnet::Gearman object.
Parameters
This method expects positional parameters.
- address
-
Address of the job server to connect to.
Result
The Net::Telnet::Gearman instance on success, undef
otherwise.
get_status
Fetch status information from configured Gearman job servers.
Result
An array reference with hash references containing status information.
call
Specialized call method which retrieves the job server status information and transforms it to HTML.
Result
A PSGI response.
SEE ALSO
Plack and Plack::Component.
Net::Telnet::Gearman which is used to access a Gearman job server.
gearman-stat.psgi
(https://github.com/tokuhirom/gearman-stat.psgi) by TOKUHIROM which inspired this application.
AUTHOR
Manfred Stock <mstock@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Manfred Stock.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.