line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gearman::ResponseParser::Taskset; |
2
|
7
|
|
|
7
|
|
25
|
use version (); |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
304
|
|
3
|
|
|
|
|
|
|
$Gearman::ResponseParser::Taskset::VERSION = version->declare("2.002.002"); #TRIAL |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
30
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
149
|
|
6
|
7
|
|
|
7
|
|
20
|
use warnings; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
179
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
31
|
use base "Gearman::ResponseParser"; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
3236
|
|
9
|
7
|
|
|
7
|
|
38
|
use Carp (); |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
95
|
|
10
|
7
|
|
|
7
|
|
24
|
use Scalar::Util (); |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
1341
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
Gearman::ResponseParser::Taskset - gearmand response parser implementation |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 DESCRIPTION |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
derived from L |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 METHODS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
2
|
|
|
2
|
0
|
553
|
my ($class, %opts) = @_; |
27
|
2
|
|
|
|
|
3
|
my $ts = delete $opts{taskset}; |
28
|
2
|
100
|
66
|
|
|
28
|
(Scalar::Util::blessed($ts) && $ts->isa("Gearman::Taskset")) |
29
|
|
|
|
|
|
|
|| Carp::croak |
30
|
|
|
|
|
|
|
"provided taskset argument is not a Gearman::Taskset reference"; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
10
|
my $self = $class->SUPER::new(%opts); |
33
|
1
|
|
|
|
|
2
|
$self->{_taskset} = $ts; |
34
|
1
|
|
|
|
|
2
|
return $self; |
35
|
|
|
|
|
|
|
} ## end sub new |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head2 on_packet($packet, $parser) |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
provide C<$packet> to L process_packet |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=cut |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub on_packet { |
44
|
0
|
|
|
0
|
1
|
0
|
my ($self, $packet, $parser) = @_; |
45
|
0
|
|
|
|
|
0
|
$self->{_taskset}->process_packet($packet, $parser->source); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 on_error($msg) |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
die C<$msg> |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=cut |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub on_error { |
55
|
1
|
|
|
1
|
1
|
320
|
my ($self, $errmsg) = @_; |
56
|
1
|
|
|
|
|
8
|
die "ERROR: $errmsg\n"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |