Changeset 565

Show
Ignore:
Timestamp:
02/25/09 19:33:25 (9 months ago)
Author:
ykerherve
Message:

Added on_exception_cb and retry_count parameters to the driver, to pass down
to Gearman::Task

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Data/ObjectDriver/Driver/GearmanDBI.pm

    r559 r565  
    99use Data::Dumper; 
    1010 
    11 __PACKAGE__->mk_accessors(qw( dbi client func driver_arg enabled_cb uniqify_cb )); 
     11__PACKAGE__->mk_accessors(qw( 
     12    dbi client func driver_arg enabled_cb uniqify_cb 
     13    on_exception_cb retry_count 
     14)); 
    1215 
    1316sub init { 
     
    6770    my $client  = $driver->client; 
    6871 
     72    my %options = (); 
     73    $options{on_exception} = $driver->on_exception_cb 
     74        if $driver->on_exception_cb; 
     75    $options{retry_count}  = $driver->retry_count 
     76        if $driver->retry_count; 
     77 
    6978    my $res = $client->do_task( $func => 
    7079        \Storable::nfreeze( { 
     
    7584        } ), 
    7685        { 
    77             uniq => $uniq  # coalesce all requests for this data 
     86            uniq => $uniq, # coalesce all requests for this data 
     87            %options, 
    7888        } 
    7989    );