AnyEvent-Subprocess

 view release on metacpan or  search on metacpan

lib/AnyEvent/Subprocess/Handle.pm  view on Meta::CPAN

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
        $handle->_do_finalize;
        return 0;
    };
 
    push @args, on_error => $send, on_eof => $send;
 
    # if the on_read is not provided, we never get notified of handle
    # close (presumably because no watchers are ever created)
    push @args, on_read => sub { } if $is_read;
 
    my $self = $class->SUPER::new(@args);
 
    return $self;
}
 
sub on_finalize {
    my ($self, $cb) = @_;
    $self->{__on_finalize} = $cb if $cb;
 
    if($cb && $self->{destroyed} && !$self->{finalized}){
        $cb->($self);

lib/AnyEvent/Subprocess/Handle.pm  view on Meta::CPAN

73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# push_shutdown).
sub close_fh {
    my $self = shift;
    close $self->fh;
}
 
sub destroy {
    my ($self, @args) = @_;
    my $rbuf = $self->{rbuf};
    $self->_do_finalize;
    $self->SUPER::destroy(@args);
    $self->{rbuf} = $rbuf;
    $self->{destroyed} = 1;
    return;
}
 
1;
 
 
 
=pod



( run in 0.221 second using v1.01-cache-2.11-cpan-cba739cd03b )