Skip to content

Instantly share code, notes, and snippets.

@vkgtaro
Created January 9, 2010 16:30
Show Gist options
  • Save vkgtaro/272974 to your computer and use it in GitHub Desktop.
Save vkgtaro/272974 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use utf8;
use AnyEvent;
use Plack::Builder;
use IO::Handle::Util qw(io_from_getline);
my $hanlder = sub {
my $env = shift;
my $body = io_from_getline sub {
sleep 1;
return time . "hi!\n";
};
return [ 200, [ "Content-Type" => 'text/plain', ], $body ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment