NAME
Protocol::Gearman::Worker::Connection
- concrete Gearman worker over an IP socket
SYNOPSIS
use List::Util qw( sum );
use Protocol::Gearman::Worker::Connection;
my $worker = Protocol::Gearman::Worker::Connection->new(
PeerAddr => $SERVER,
) or die "Cannot connect - $@\n";
$worker->can_do( 'sum' );
while(1) {
my $job = $worker->grab_job->get;
my $total = sum split m/,/, $job->arg;
$job->complete( $total );
}
DESCRIPTION
This module combines the abstract Protocol::Gearman::Worker with Protocol::Gearman::Connection to provide a simple synchronous concrete worker implementation.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>