We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e20b17 commit 4ef1954Copy full SHA for 4ef1954
lib/Gearman/Task.pm
@@ -121,6 +121,7 @@ use fields (
121
# opts from client:
122
'uniq',
123
'on_complete',
124
+ 'on_data',
125
'on_fail',
126
'on_exception',
127
'on_retry',
@@ -416,6 +417,18 @@ sub status {
416
417
$self->{on_status}->($nu, $de);
418
} ## end sub status
419
420
+=head2 data()
421
+
422
+=cut
423
424
+sub data {
425
+ my Gearman::Task $task = shift;
426
+ return if $task->{is_finished};
427
+ my $result_ref = shift;
428
429
+ $task->{on_data}->($result_ref) if $task->{on_data};
430
+} ## end sub data
431
432
=head2 handle()
433
434
getter
0 commit comments