Skip to content

Instantly share code, notes, and snippets.

@koba04
Created January 14, 2011 10:23
Show Gist options
  • Save koba04/779451 to your computer and use it in GitHub Desktop.
Save koba04/779451 to your computer and use it in GitHub Desktop.
Gearman Worker Script
#!perl
use strict;
use warnings;
use utf8;
use Gearman::Worker;
my $worker = Gearman::Worker->new;
my $cnt = 0;
$worker->job_servers('127.0.0.1');
$worker->register_function( 'onegai' => sub { sleep(3); print "onegai count $cnt\n"; return $cnt++} );
$worker->work;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment