i have a problem one Gearman::Client or Gearman::Task. for this way,
Gearman::Task->new($func, $arg, \%options)
i set the options "uniq" and "timeout", but it cannot work,
use Gearman::Client; my $client = Gearman::Client->new; $client->job_servers('127.0.0.1:7003'); my $taskset = $client->new_task_set; $taskset->add_task('fun' => undef ,{ uniq => 1, on_complete => sub{print ${$_[0]}}, timeout => 2, } ); $taskset->wait;
-----------
use Gearman::Worker; my $worker = Gearman::Worker->new; $worker->job_servers('127.0.0.1:7003'); $worker->register_function('fun' =>\&w); $worker->work while 1; sub w{ print "3"; return 3; }
i want to resold 2 problem, 1) run the same names of functions on workers in parallel, so i try the option "uniq", but it's not any result. 2) runing when the client call a function not existed, so i try the timeout, but ..
or help me how to get functions registed on server.
Plz help me, thxIn reply to about Gearman::Client options by liuweichuan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |