Skip to content

Instantly share code, notes, and snippets.

@koba04
Created January 14, 2011 10:22
Show Gist options
  • Save koba04/779448 to your computer and use it in GitHub Desktop.
Save koba04/779448 to your computer and use it in GitHub Desktop.
Gearman Client Script
#!perl
use strict;
use warnings;
use utf8;
use Gearman::Client;
use Gearman::Task;
my $client = Gearman::Client->new;
$client->job_servers('127.0.0.1');
for (1..10) {
# background
$client->dispatch_background(
Gearman::Task->new("onegai",\"", {})
);
# foreground
print ${$client->do_task("onegai")} . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment