| 1 | package TAP::Parser::Iterator::Stream::Selectable; | ||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use vars (qw($VERSION @ISA)); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | |||||||||||||
| 5 | 2 | ▶ | use TAP::Parser::Iterator::Stream (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | @ISA = 'TAP::Parser::Iterator::Stream'; | |||||||||||
| 7 | |||||||||||||
| 8 | =head1 NAME | ||||||||||||
| 9 | |||||||||||||
| 10 | TAP::Parser::Iterator::Stream::Selectable - Stream TAP from an L<IO::Handle> or a GLOB. | ||||||||||||
| 11 | |||||||||||||
| 12 | =head1 VERSION | ||||||||||||
| 13 | |||||||||||||
| 14 | Version 0.01 | ||||||||||||
| 15 | |||||||||||||
| 16 | =cut | ||||||||||||
| 17 | |||||||||||||
| 18 | 2 | $VERSION = '0.01'; | |||||||||||
| 19 | |||||||||||||
| 20 | 2 | ▶ | sub _initialize { | ||||||||||
|
Subroutine
_initialize: called CC=4 SCAR=14.3
| |||||||||||||
| 21 | 2 | my ( $self, $args ) = @_; | |||||||||||
| 22 | 2 | ▶ | unless ( $args->{handle} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 23 | 0 | die "handle argument must be specified.\n"; | |||||||||||
| 24 | } | ||||||||||||
| 25 | 2 | ▶ | my $chunk_size = delete $args->{_chunk_size} || 65536; | ||||||||||
|
Condition50%1/2
delete $args->{'_chunk_size'} || 65536
MC/DC0%0/1
delete $args->{'_chunk_size'} || 65536
delete $args->{'_chunk_size'}
Truth table50%1/2
A
A= delete $args->{'_chunk_size'}
| |||||||||||||
| 26 | 2 | ▶ | return unless ( $self->SUPER::_initialize( $args->{handle} ) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 2 | $self->{out} = $args->{handle}; | |||||||||||
| 28 | 2 | $self->{err} = $args->{handle}; | |||||||||||
| 29 | 2 | $self->{sel} = IO::Select->new( $args->{handle} ); | |||||||||||
| 30 | 2 | $self->{pid} = ''; | |||||||||||
| 31 | 2 | $self->{exit} = undef; | |||||||||||
| 32 | 2 | $self->{chunk_size} = $chunk_size; | |||||||||||
| 33 | 2 | return $self; | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | =head3 C<get_select_handles> | ||||||||||||
| 37 | |||||||||||||
| 38 | Return a list of filehandles that may be used upstream in a select() | ||||||||||||
| 39 | call to signal that this Iterator is ready. Iterators that are not | ||||||||||||
| 40 | handle based should return an empty list. | ||||||||||||
| 41 | |||||||||||||
| 42 | =cut | ||||||||||||
| 43 | |||||||||||||
| 44 | 0 | ▶ | sub get_select_handles { | ||||||||||
|
Subroutine
get_select_handles: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 45 | 0 | my $self = shift; | |||||||||||
| 46 | 0 | return grep $_, ( $self->{out}, $self->{err} ); | |||||||||||
| 47 | } | ||||||||||||
| 48 | |||||||||||||
| 49 | 2 | 1; | |||||||||||
| 50 | |||||||||||||
| 51 | __END__ | ||||||||||||