Net::Gearman::Worker - concrete Gearman worker over an IP socket
Net::Gearman::Worker
use List::Util qw( sum ); use Net::Gearman::Worker; my $worker = Net::Gearman::Worker->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 ); }
This module combines the abstract Protocol::Gearman::Worker with Net::Gearman to provide a simple synchronous concrete worker implementation.
Paul Evans <leonerd@leonerd.org.uk>
To install Protocol::Gearman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Protocol::Gearman
CPAN shell
perl -MCPAN -e shell install Protocol::Gearman
For more information on module installation, please visit the detailed CPAN module installation guide.