You are here

public function CurlMultiHandler::__invoke in Auth0 Single Sign On 8.2

File

vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php, line 81

Class

CurlMultiHandler
Returns an asynchronous response using curl_multi_* functions.

Namespace

GuzzleHttp\Handler

Code

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;
}