| 1 | package AnyEvent::Subprocess::Running::Delegate::Callback; | ||
| 2 | 48 | ▶ | BEGIN { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 48 | $AnyEvent::Subprocess::Running::Delegate::Callback::VERSION = '1.102912'; | |
| 4 | } | ||
| 5 | # ABSTRACT: the C<Running> part of the Callback delegate | ||
| 6 | 48 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 48 | ▶ | use AnyEvent::Subprocess::Done::Delegate::State; # name change |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 47 | with 'AnyEvent::Subprocess::Running::Delegate'; | |
| 11 | |||
| 12 | has 'completion_hook' => ( | ||
| 13 | init_arg => 'completion_hook', | ||
| 14 | reader => '_completion_hook', | ||
| 15 | isa => 'CodeRef', | ||
| 16 | 0 | ▶ | default => sub { sub {} }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 17 | 47 | required => 1, | |
| 18 | ); | ||
| 19 | |||
| 20 | |||
| 21 | has 'state' => ( | ||
| 22 | is => 'ro', | ||
| 23 | isa => 'HashRef', | ||
| 24 | required => 1, | ||
| 25 | 0 | ▶ | default => sub { +{} }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 26 | 47 | ); | |
| 27 | |||
| 28 | 1 | ▶ | sub completion_hook { |
|
Subroutine
completion_hook: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 29 | 1 | my ($self, $running, @args) = @_; | |
| 30 | 1 | $self->_completion_hook->($self, @args); | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | ▶ | sub build_done_delegates { |
|
Subroutine
build_done_delegates: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 34 | 1 | my ($self) = @_; | |
| 35 | 1 | return AnyEvent::Subprocess::Done::Delegate::State->new( | |
| 36 | name => $self->name, | ||
| 37 | state => $self->state, | ||
| 38 | ); | ||
| 39 | } | ||
| 40 | 4 | ▶ | sub build_events {} |
|
Subroutine
build_events: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 41 | |||
| 42 | 47 | __PACKAGE__->meta->make_immutable; | |
| 43 | |||
| 44 | 47 | 1; | |
| 45 | |||
| 46 | |||
| 47 | |||
| 48 | =pod | ||
| 49 | |||
| 50 | =head1 NAME | ||
| 51 | |||
| 52 | AnyEvent::Subprocess::Running::Delegate::Callback - the C<Running> part of the Callback delegate | ||
| 53 | |||
| 54 | =head1 VERSION | ||
| 55 | |||
| 56 | version 1.102912 | ||
| 57 | |||
| 58 | =head1 DESCRIPTION | ||
| 59 | |||
| 60 | Calls the completion hook that was setup in the Job delegate, passes | ||
| 61 | saved state to the Done delegate. | ||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Jonathan Rockway <jrockway@cpan.org> | ||
| 66 | |||
| 67 | =head1 COPYRIGHT AND LICENSE | ||
| 68 | |||
| 69 | This software is copyright (c) 2011 by Jonathan Rockway. | ||
| 70 | |||
| 71 | This is free software; you can redistribute it and/or modify it under | ||
| 72 | the same terms as the Perl 5 programming language system itself. | ||
| 73 | |||
| 74 | =cut | ||
| 75 | |||
| 76 | |||
| 77 | __END__ | ||