Voting

: one minus one?
(Example: nine)

The Note You're Voting On

stanislav dot reshetnev at gmail dot com
10 years ago
Note that param $unique must be different for multiple tasks if You want to run they all separately. If param $unique is equal for multiple tasks You will get the same task:

<?php
$unique
=1;

$gclient = GearmanClient();
$gclient->addServer('srv');

$this->setCreatedCallback(function(GearmanTask $task) {
print
$task->jobHandle() . "\n";
});

$gclient->addTask('function_name', 'workload', null, $unique);
$gclient->addTask('function_name', 'workload', null, $unique);
$gclient->addTask('function_name', 'workload', null, $unique);
$gclient->runTasks();

sleep(5);
?>

This sript will print only one handler:

H:srv:377382343
H:srv:377382343
H:srv:377382343

<< Back to user notes page

To Top