Asynchronous job processing

Andrew Shitov andy at shitov.ru
Mon Dec 17 20:06:16 UTC 2007


> One way to do this would be to use dispatch_background(), but I
> don't see how you can pick up results later if you do that.

Considered using on_complete?


my $taskset = $client->new_task_set();
$taskset->add_task("nslookup" => 'rian.ru', {
    on_complete => sub {print ${$_[0]}}
});
$taskset->add_task("host" => 'rian.ru', {
    on_complete => sub {print ${$_[0]}}
});
$taskset->wait;




--
Andrew Shitov
______________________________________________________________________
andy at shitov.ru | http://www.shitov.ru



More information about the Gearman mailing list