Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created October 17, 2015 13:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tokuhirom/a0b4d844d321f06d06e8 to your computer and use it in GitHub Desktop.
This script stuck with `ab -c 10 -n 1000 http://127.0.0.1:15555/`
use v6;
my $port = 15555;
my $host = '127.0.0.1';
say "$host:$port";
react {
whenever IO::Socket::Async.listen($host, $port) -> $conn {
my $chan = $conn.chars-supply.Channel;
$chan.receive.perl.say;
await $conn.write("HTTP/1.0 200 OK\r\n\r\n".encode);
$conn.close;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment