Net::Telnet::Gearman - interact with a Gearman server through its telnet interface
use Net::Telnet::Gearman; my $session = Net::Telnet::Gearman->new( Host => '127.0.0.1', Port => 4730, ); my @workers = $session->workers(); my @functions = $session->status(); my $version = $session->version(); my $result = $session->maxqueue( reverse => 15 ); $session->shutdown('graceful');
This is currently only tested with Gearman v0.10.
This is the same as in Net::Telnet except for that there is called $self->open() for you.
$self->open()
This sends back a list of all workers, their file descriptors, their IPs, their IDs, and a list of registered functions they can perform.
See also: Net::Telnet::Gearman::Worker
This method accepts any parameters the Net::Telnet getline method does accept.
getline
This sends back a list of all registered functions. Next to each function is the number of jobs in the queue, the number of running jobs, and the number of capable workers.
See also: Net::Telnet::Gearman::Function
This sets the maximum queue size for a function. If no size is given, the default is used. If the size is negative, then the queue is set to be unlimited. This sends back a single line with "OK".
Arguments:
Function name
Maximum queue size (optional)
Shutdown the server. If the optional "graceful" argument is used, close the listening socket and let all existing connections complete.
"graceful" (optional)
Send back the version of the server.
Johannes Plunien <plu@cpan.org>
Copyright 2009 by Johannes Plunien
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Net::Telnet
http://gearman.org/index.php?id=protocol
http://github.com/plu/net-telnet-gearman/
To install Net::Telnet::Gearman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Telnet::Gearman
CPAN shell
perl -MCPAN -e shell install Net::Telnet::Gearman
For more information on module installation, please visit the detailed CPAN module installation guide.