NAME

Net::Telnet::Gearman - interact with a Gearman server through its telnet interface

SYNOPSIS

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

DESCRIPTION

This is currently only tested with Gearman v0.10.

METHODS

new

This is the same as in Net::Telnet except for that there is called $self->open() for you.

workers

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.

status

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 method accepts any parameters the Net::Telnet getline method does accept.

maxqueue

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

Shutdown the server. If the optional "graceful" argument is used, close the listening socket and let all existing connections complete.

Arguments:

  • "graceful" (optional)

version

Send back the version of the server.

AUTHOR

Johannes Plunien <plu@cpan.org>

COPYRIGHT AND LICENSE

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.

SEE ALSO

REPOSITORY

http://github.com/plu/net-telnet-gearman/