Created
January 14, 2011 10:22
-
-
Save koba04/779448 to your computer and use it in GitHub Desktop.
Gearman Client Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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