public function CurlMultiHandler::__invoke in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php \GuzzleHttp\Handler\CurlMultiHandler::__invoke()
File
- vendor/
guzzlehttp/ guzzle/ src/ Handler/ CurlMultiHandler.php, line 61
Class
- CurlMultiHandler
- Returns an asynchronous response using curl_multi_* functions.
Namespace
GuzzleHttp\HandlerCode
public function __invoke(RequestInterface $request, array $options) {
$easy = $this->factory
->create($request, $options);
$id = (int) $easy->handle;
$promise = new Promise([
$this,
'execute',
], function () use ($id) {
return $this
->cancel($id);
});
$this
->addRequest([
'easy' => $easy,
'deferred' => $promise,
]);
return $promise;
}