Sends the request using , enabling parallel requests. Uses the "rolling" method.
public send_multi_request ( array $handles, array $opt = null ) : array | ||
$handles | array | (Required) An indexed array of cURL handles to process simultaneously. |
$opt | array | (Optional) An associative array of parameters that can have the following keys:
|
return | array | Post-processed cURL responses. |
public function testSendMultiRequest() { $httpCore = new RequestCore("http://www.baidu.com"); $ch1 = curl_init("http://www.baidu.com"); curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); $ch2 = curl_init("http://cn.bing.com"); curl_setopt($ch2, CURLOPT_RETURNTRANSFER, 1); @($result = $httpCore->send_multi_request(array($ch1, $ch2))); $this->assertNotNull($result); }
public function testSendMultiRequest() { $httpCore = new RequestCore("http://www.baidu.com"); @($result = $httpCore->send_multi_request(array(curl_init("http://www.baidu.com"), curl_init("http://www.baidu.com")))); $this->assertNotNull($result); }