Skip Menu |

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

Report information
The Basics
Id: 52053
Status: open
Priority: 0/
Queue: AnyEvent-Gearman

People
Owner: melo [...] cpan.org
Requestors: VKHERA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.06
Fixed in: (no value)



Subject: no way to set unique ID for job
The C gearmand server requires the client specify a unique ID for each job (at least background jobs). There is no way with this module for the client to do so, making it impossible to submit more than one background job at a time.
On Tue Nov 24 22:06:48 2009, VKHERA wrote: Show quoted text
> The C gearmand server requires the client specify a unique ID for each > job (at least background > jobs). There is no way with this module for the client to do so, > making it impossible to submit > more than one background job at a time.
Try this: $gearman->add_task( $function => $workload, unique => 'unique_id_for_the_job', on_complete => sub { my $res = $_[1]; }, on_fail => sub { # job failed }, ); And I will mention about this in doc at next release. Thanks.
On Tue Nov 24 23:41:21 2009, TYPESTER wrote: Show quoted text
> Try this: > > $gearman->add_task( > $function => $workload, > unique => 'unique_id_for_the_job', > on_complete => sub {
Wonderful. Now that I go back and re-read the Task.pm code, this becomes obvious :-) By the way, I'm comparing the various clients for perl, and this one is just as fast as the XS version to inject 10,000 jobs. Thanks for sharing your module.