Skip Menu |

This queue is for tickets about the Gearman-XS CPAN distribution.

Report information
The Basics
Id: 55449
Status: rejected
Priority: 0/
Queue: Gearman-XS

People
Owner: Nobody in particular
Requestors: DOUGW [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.8
Fixed in: (no value)



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.
Mostly nevermind...add_task() has only two arguments, and it behaves correctly if only two args are passed to it. The strange behavior happens when you pass 4 args to it, which was a typo on my part. So this is still possibly a minor bug about args checking.
Subject: add_task not validating number of arguments
On Wed Mar 10 15:43:59 2010, DOUGW wrote: Show quoted text
> > Mostly nevermind...add_task() has only two arguments, and it behaves > correctly if only two args are passed to it. The strange behavior > happens when you pass 4 args
correction: 3 or more args.
add_task() task an optional 3 argument, the unique id. If you pass the same id to all calls the server will run the job only once and return the same result to all calls.