Skip to content

Instantly share code, notes, and snippets.

@athomason
Created May 19, 2011 23:08
Show Gist options
  • Save athomason/981996 to your computer and use it in GitHub Desktop.
Save athomason/981996 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use Danga::Socket;
use Gearman::Client::Async;
my $count = shift || 1000;
my $client = Gearman::Client::Async->new(job_servers => ['127.0.0.1:7003']);
my $done = 0;
sub done {
exit if ++$done > $count;
new();
}
sub new {
$client->add_task(Gearman::Task->new(
test => \1 => {
on_complete => \&done,
on_fail => \&done,
}));
}
new();
Danga::Socket->EventLoop;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment