Skip to content

Instantly share code, notes, and snippets.

@nihen
Created October 13, 2009 03:43
Show Gist options
  • Save nihen/208956 to your computer and use it in GitHub Desktop.
Save nihen/208956 to your computer and use it in GitHub Desktop.
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