curl asynchrone pool
$rand = rand(1, 10); $curl = new \Curl\Curl(); $curl->on('success', function ($instance) { echo 'call to "' . $instance->url . '" was successful.' . "\n"; }); $curl->on('error', function ($instance) { echo 'call to "' . $instance->url . '" was unsuccessful.' . "\n"; echo 'error code: ' . $instance->errorCode . "\n"; echo 'error message: ' . $instance->errorMessage . "\n"; }); $curl->on('complete', function ($instance) { echo 'call to "' . $instance->url . '" completed.' . "\n"; }); for ($i = 1; $i <= $rand; $i++) { $curl->get('http://www.example.com/'); } $curl->start();