我看vendor里有 Illuminate\Support\Facades\Http; 但是 use Illuminate\Support\Facades\Http后使用报错啦
有推荐的吗
guzzle
感谢,已经整上了
private function createClientPoolD($urls, $method) { $this->totalPageCount = count($urls); $client = new Client(); $requests = function ($urls) use ($client,$method) { foreach ($urls as $url){ //print_r($url['options']); yield function () use ($url,$client,$method){ return $client->requestAsync($method, $url['url'], $url['options']); }; } }; $pool = new Pool($client, $requests($urls), [ 'concurrency' => 100, 'fulfilled' => function ($response, $index) { $this->successHandel($response, $index); }, 'rejected' => function ($reason, $index) { $this->rejectHandel($reason, $index); }, ]); return $pool; }
guzzle
感谢,已经整上了