| 1 | package Flux::In::Role::Easy; | ||||||||||
| 2 | { | ||||||||||
| 3 | 2 | $Flux::In::Role::Easy::VERSION = '1.03'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: simplified version of Flux::In role | ||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | 2 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 2 | with 'Flux::In'; | |||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub read_chunk { | ||||||||
|
Subroutine
read_chunk: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||
| 13 | 0 | my $self = shift; | |||||||||
| 14 | 0 | my ($limit) = @_; | |||||||||
| 15 | |||||||||||
| 16 | 0 | my @chunk; | |||||||||
| 17 | 0 | ▶ | while (defined($_ = $self->read)) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | push @chunk, $_; | |||||||||
| 19 | 0 | ▶ | last if @chunk >= $limit; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | } | ||||||||||
| 21 | 0 | ▶ | return unless @chunk; # return false if nothing can be read | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | return \@chunk; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub commit { | ||||||||
|
Subroutine
commit: not called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | 2 | 1; | |||||||||
| 30 | |||||||||||
| 31 | __END__ | ||||||||||