Subprocess/Job/Delegate/Callback.pm

filter: Statementstmt 91.1% 31 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 12 / 15 Podpod 0.0% 0 / 8 totaltotal 75.4% 43 / 57 CC 1 SCAR 1.3
CC
1
Cov
91%
__ANON__
2.0
receive_child_error
2.0
BEGIN
1.0
CRAP 1.1
« Subprocess/Job/Delegate/MonitorHandle.pm ↑ Summary Subprocess/Job/Delegate/PrintError.pm »
1 package AnyEvent::Subprocess::Job::Delegate::Callback;
2 48 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 48 $AnyEvent::Subprocess::Job::Delegate::Callback::VERSION = '1.102912';
4 }
5 # ABSTRACT: call callbacks for each job/run/done step
6 48 ▶use AnyEvent::Subprocess::Running::Delegate::Callback;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 48 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 48 ▶use MooseX::StrictConstructor;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 47 with 'AnyEvent::Subprocess::Job::Delegate';
11  
12 47 for my $a (qw/child_setup_hook child_finalize_hook
13 parent_setup_hook parent_finalize_hook
14 completion_hook build_code_args receive_child_result
15 receive_child_error/) {
16  
17 has $a => (
18 init_arg => $a,
19 reader => "_$a",
20 isa => 'CodeRef',
21 4 ▶ default => sub { sub {} },
Subroutine __ANON__: called CC=1 SCAR=0.0
Subroutine __ANON__: not called CC=1 SCAR=0.0
22 376 required => 1,
23 );
24 }
25  
26 has 'state' => (
27 is => 'ro',
28 isa => 'HashRef',
29 required => 1,
30 0 ▶ default => sub { +{} },
Subroutine __ANON__: not called CC=1 SCAR=6.9
31 47 );
32  
33 2 ▶sub build_run_delegates {
Subroutine build_run_delegates: called CC=1 SCAR=0.0
Pod undocumented
34 2 my $self = shift;
35 2 return AnyEvent::Subprocess::Running::Delegate::Callback->new(
36 name => $self->name,
37 completion_hook => $self->_completion_hook,
38 state => $self->state,
39 );
40 }
41  
42 1 ▶sub child_setup_hook {
Subroutine child_setup_hook: called CC=1 SCAR=0.0
Pod undocumented
43 1 my ($self, $job) = @_;
44 1 $self->_child_setup_hook->($self, $job);
45 }
46  
47 1 ▶sub child_finalize_hook {
Subroutine child_finalize_hook: called CC=1 SCAR=0.0
Pod undocumented
48 1 my ($self, $job) = @_;
49 1 $self->_child_finalize_hook->($self, $job);
50 }
51  
52 2 ▶sub parent_setup_hook {
Subroutine parent_setup_hook: called CC=1 SCAR=0.0
Pod undocumented
53 2 my ($self, $job, $run) = @_;
54 2 $self->_parent_setup_hook->($self, $job, $run);
55 }
56  
57 1 ▶sub parent_finalize_hook {
Subroutine parent_finalize_hook: called CC=1 SCAR=0.0
Pod undocumented
58 1 my ($self, $job) = @_;
59 1 $self->_parent_finalize_hook->($self, $job);
60 }
61  
62 1 ▶sub build_code_args {
Subroutine build_code_args: called CC=1 SCAR=0.0
Pod undocumented
63 1 my ($self, $job) = @_;
64 1 return $self->_build_code_args->($self, $job);
65 }
66  
67 1 ▶sub receive_child_result {
Subroutine receive_child_result: called CC=1 SCAR=0.0
Pod undocumented
68 1 my ($self, $job, $result) = @_;
69 1 return $self->_receive_child_result->($self, $job, $result);
70 }
71  
72 0 ▶sub receive_child_error {
Subroutine receive_child_error: not called CC=1 SCAR=6.9
Pod undocumented
73 0 my ($self, $job, $error) = @_;
74 0 return $self->_receive_child_error->($self, $job, $error);
75 }
76  
77 47 1;
78  
79 47 __PACKAGE__->meta->make_immutable;
80  
81 __END__
« Subprocess/Job/Delegate/MonitorHandle.pm ↑ Summary Subprocess/Job/Delegate/PrintError.pm »