| 1 | package AnyEvent::Subprocess::Job::Delegate::PrintError; | ||||||||||
| 2 | 48 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 48 | $AnyEvent::Subprocess::Job::Delegate::PrintError::VERSION = '1.102912'; | |||||||||
| 4 | } | ||||||||||
| 5 | # ABSTRACT: Print errors to a filehandle | ||||||||||
| 6 | 48 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 48 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 47 | with 'AnyEvent::Subprocess::Job::Delegate'; | |||||||||
| 9 | |||||||||||
| 10 | has 'handle' => ( | ||||||||||
| 11 | is => 'ro', | ||||||||||
| 12 | isa => 'GlobRef', | ||||||||||
| 13 | 32 | ▶ | default => sub { \*STDERR }, | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 47 | ); | |||||||||
| 15 | |||||||||||
| 16 | has 'callback' => ( | ||||||||||
| 17 | is => 'ro', | ||||||||||
| 18 | isa => 'CodeRef', | ||||||||||
| 19 | 32 | ▶ | default => sub { | ||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 32 | my $self = shift; | |||||||||
| 21 | 1 | ▶ | return sub { | ||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||
| 22 | 1 | my $msg = join '', @_; | |||||||||
| 23 | 1 | ▶ | $msg .= "\n" unless $msg =~ /\n$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 1 | print {$self->handle} ($msg); | |||||||||
| 25 | } | ||||||||||
| 26 | 32 | }, | |||||||||
| 27 | 47 | ); | |||||||||
| 28 | |||||||||||
| 29 | 1 | ▶ | sub receive_child_error { | ||||||||
|
Subroutine
receive_child_error: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 30 | 1 | my ($self, $job, $error) = @_; | |||||||||
| 31 | 1 | $self->callback->($error); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 16 | ▶ | sub build_run_delegates {} | ||||||||
|
Subroutine
build_run_delegates: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 35 | 6 | ▶ | sub child_setup_hook {} | ||||||||
|
Subroutine
child_setup_hook: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 36 | 1 | ▶ | sub child_finalize_hook {} | ||||||||
|
Subroutine
child_finalize_hook: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 37 | 16 | ▶ | sub parent_setup_hook {} | ||||||||
|
Subroutine
parent_setup_hook: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 38 | 10 | ▶ | sub parent_finalize_hook {} | ||||||||
|
Subroutine
parent_finalize_hook: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 39 | 6 | ▶ | sub build_code_args {} | ||||||||
|
Subroutine
build_code_args: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 40 | 0 | ▶ | sub receive_child_result {} | ||||||||
|
Subroutine
receive_child_result: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 41 | |||||||||||
| 42 | 47 | __PACKAGE__->meta->make_immutable; | |||||||||
| 43 | |||||||||||
| 44 | 47 | 1; | |||||||||
| 45 | |||||||||||
| 46 | __END__ | ||||||||||