1 package TestApp::Controller::Action::Streaming;
4 use base 'TestApp::Controller::Action';
6 sub streaming : Global {
8 for my $line ( split "\n", <<'EOF' ) {
13 $c->res->write("$line\n");
18 my ( $self, $c ) = @_;
20 my $file = "$FindBin::Bin/../lib/TestApp/Controller/Action/Streaming.pm";
21 my $fh = IO::File->new( $file, 'r' );
26 $c->res->body( "Unable to read $file" );
30 sub body_large : Local {
33 # more than one write with the default chunksize
34 my $size = 128 * 1024;
36 my $data = "\0" x $size;
37 open my $fh, '<', \$data;
38 $c->res->content_length($size);