| 1 | package Gearman::ResponseParser::Taskset; | ||||||||||||||||||||||||||||
| 2 | 7 | ▶ | use version (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 7 | $Gearman::ResponseParser::Taskset::VERSION = version->declare("2.004.015"); | |||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 7 | ▶ | use base "Gearman::ResponseParser"; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 7 | ▶ | use Carp (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 7 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | =head1 NAME | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | Gearman::ResponseParser::Taskset - gearmand response parser implementation | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | derived from L<Gearman::ResponseParser> | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | =head1 METHODS | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | =cut | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 2 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | 2 | my ($class, %opts) = @_; | |||||||||||||||||||||||||||
| 27 | 2 | my $ts = delete $opts{taskset}; | |||||||||||||||||||||||||||
| 28 | 2 | ▶ | (Scalar::Util::blessed($ts) && $ts->isa("Gearman::Taskset")) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
builtin::blessed($ts) and $ts->isa("Gearman::Taskset")
MC/DC50%1/2
builtin::blessed($ts) and $ts->isa("Gearman::Taskset")
builtin::blessed($ts)
$ts->isa("Gearman::Taskset")
Truth table66%2/3
A and B
A= builtin::blessed($ts)B= $ts->isa("Gearman::Taskset")
| |||||||||||||||||||||||||||||
| 29 | || Carp::croak | ||||||||||||||||||||||||||||
| 30 | "provided taskset argument is not a Gearman::Taskset reference"; | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 1 | my $self = $class->SUPER::new(%opts); | |||||||||||||||||||||||||||
| 33 | 1 | $self->{_taskset} = $ts; | |||||||||||||||||||||||||||
| 34 | 1 | return $self; | |||||||||||||||||||||||||||
| 35 | } ## end sub new | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | =head2 on_packet($packet, $parser) | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | provide C<$packet> to L<Gearman::Taskset> process_packet | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | =cut | ||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | sub on_packet { | ||||||||||||||||||||||||||
|
Subroutine
on_packet: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 44 | 0 | my ($self, $packet, $parser) = @_; | |||||||||||||||||||||||||||
| 45 | 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 | 1 | ▶ | sub on_error { | ||||||||||||||||||||||||||
|
Subroutine
on_error: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 55 | 1 | my ($self, $errmsg) = @_; | |||||||||||||||||||||||||||
| 56 | 1 | die "ERROR: $errmsg\n"; | |||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 7 | 1; | |||||||||||||||||||||||||||