File Coverage

blib/lib/Plack/App/CGIBin/Streaming/IO.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 4 50.0
condition n/a
subroutine 8 8 100.0
pod 0 2 0.0
total 30 34 88.2


line stmt bran cond sub pod time code
1             package Plack::App::CGIBin::Streaming::IO;
2              
3 15     15   246 use 5.014;
  15         48  
  15         528  
4 15     15   141 use strict;
  15         24  
  15         480  
5 15     15   72 use warnings;
  15         30  
  15         339  
6 15     15   93 use Plack::App::CGIBin::Streaming;
  15         24  
  15         2574  
7              
8             sub PUSHED {
9             #my ($class, $mode, $fh) = @_;
10              
11 51     51 0 18978 return bless +{}, $_[0];
12             }
13              
14             sub WRITE {
15             #my ($self, $buf, $fh) = @_;
16              
17 83329     83329   828602 $Plack::App::CGIBin::Streaming::R->print_content($_[1]);
18 83329         323875 return length $_[1];
19             }
20              
21             sub FLUSH {
22             #my ($self, $fh) = @_;
23              
24 49 50   49 0 171 return 0 if $_[0]->{in_flush};
25 49         132 local $_[0]->{in_flush}=1;
26              
27 49 50       152 $Plack::App::CGIBin::Streaming::R->flush
28             unless $Plack::App::CGIBin::Streaming::R->suppress_flush;
29              
30 49         497 return 0;
31             }
32              
33             sub READ {
34             #my ($self, $buf, $len, $fh) = @_;
35              
36 80106     80106   222353 return $_[3]->read($_[1], $_[2]);
37             }
38              
39             1;
40              
41             __END__