Subject: | add_task not capturing current values |
Here is a snippet from a slightly modified client_cb.pl from the
examples directory of the distribution:
my $str = $ARGV[0];
for (1..REVERSE_TASKS)
{
my ($ret, $task) = $client->add_task('reverse', $str, 0);
if ($ret != GEARMAN_SUCCESS)
{
printf(STDERR "%s\n", $client->error());
exit(1);
}
printf("Added: %s\n", $task->unique());
$str++;
}
The completed_cb function prints the results of the last task added for
every task that was added. E.g. if REVERSE_TASKS is 3, and the string is
"abc", the results "eba" are printed 3 times.