Created
October 13, 2009 03:43
-
-
Save nihen/208956 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Plack::Builder; | |
{ | |
package Hoge; | |
sub new { | |
bless [1] => shift; | |
} | |
sub getline { | |
my $self = shift; | |
if ( $self->[0]++ > 10 ) { | |
return; | |
} | |
sleep(2); | |
return ("100" x 10) . "\n"; | |
} | |
sub close {} | |
} | |
my $app = sub { | |
my $env = shift; | |
return ['200', ['Content-Type' => 'text/plain'], Hoge->new]; | |
}; | |
builder { | |
$app; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment