line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gearman::ResponseParser::Taskset; |
2
|
7
|
|
|
7
|
|
23
|
use version (); |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
218
|
|
3
|
|
|
|
|
|
|
$Gearman::ResponseParser::Taskset::VERSION = version->declare("2.003_002"); |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
22
|
use strict; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
109
|
|
6
|
7
|
|
|
7
|
|
19
|
use warnings; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
142
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
22
|
use base "Gearman::ResponseParser"; |
|
7
|
|
|
|
|
7
|
|
|
7
|
|
|
|
|
2445
|
|
9
|
7
|
|
|
7
|
|
28
|
use Carp (); |
|
7
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
72
|
|
10
|
7
|
|
|
7
|
|
20
|
use Scalar::Util (); |
|
7
|
|
|
|
|
6
|
|
|
7
|
|
|
|
|
906
|
|
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
|
765
|
my ($class, %opts) = @_; |
27
|
2
|
|
|
|
|
3
|
my $ts = delete $opts{taskset}; |
28
|
2
|
100
|
66
|
|
|
30
|
(Scalar::Util::blessed($ts) && $ts->isa("Gearman::Taskset")) |
29
|
|
|
|
|
|
|
|| Carp::croak |
30
|
|
|
|
|
|
|
"provided taskset argument is not a Gearman::Taskset reference"; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
9
|
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
|
369
|
my ($self, $errmsg) = @_; |
56
|
1
|
|
|
|
|
6
|
die "ERROR: $errmsg\n"; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |