Slide 85
Slide 85 text
sample11.php
$client = new Client();
$requests = function() {
for ($i = 0; $i < 10000; ++$i) {
yield new Request('GET', 'http://localhost:8008/');
}
};
$pool = new Pool($client, $requests(), [
'concurrency' => 1000,
'fulfilled' => function(ResponseInterface $response, $index)
{
echo sprintf("%5d: %s\n", $index, $response->getBody());
},
]);
$promise = $pool->promise();
$promise->wait();