$pool = new Pool($client, $requests, [
'concurrency' => 5,
'fulfilled' => function ($response, $index) use($requests, &$results) {
echo $index.' - '.$requests[$index]->getUri()->__toString().' --'. $response->getStatusCode().PHP_EOL;
$results[$index]=$response;
},
'rejected' => function ($reason, $index)use($requests, &$results) {
echo $index.' - '.$requests[$index]->getUri()->__toString().' --'. $reason.PHP_EOL;
$results[$index]=$reason;
},
]);