I'm learning Hacklang and as a quick test wanted to verify that asynchronous features worked the way I understood them to: that the execution thread would hop over to handle another request while an async operation was in progress.
To test this I wrote this simple index.php:
<?hh
<<__EntryPoint>>
async function main(): Awaitable<void> {
echo "Start sleep<br />\n";
flush();
await \HH\Asio\usleep(10000000);
echo "End sleep\n";
}
Visiting the page in a browser it behaves as you would expect: you immediately see "Start sleep" then 10 seconds later you see "End sleep" appear beneath it.
I then ran a BlazeMeter test to hammer it with 50 requests per second. If the async / await stuff was working properly, it should trivially handle all 50 requests and the requests should have an average response time around 10 seconds. But instead I saw this:
What am I doing wrong?
