src/Core/Client.php
public function executeAsync(ClientRequestInterface $request, array $headers = null, array $clientOptions = [])
    {
        if ($request instanceof ContextAwareInterface) {
            $request->setContextIfNull($this->getConfig()->getContext());
        }
        $httpRequest = $this->createHttpRequest($request, $headers);
        $client = $this->getHttpClient();
        if ($client instanceof AdapterOptionInterface) {
            $response = $request->buildResponse($client->executeAsync($httpRequest, $clientOptions));
        } else {
            $response = $request->buildResponse($client->executeAsync($httpRequest));
        }

        $response = $response->then(
            function ($httpResponse) use ($httpRequest) {
                $this->logDeprecatedRequest($httpResponse, $httpRequest);
                return $httpResponse;
            }
        );

        return $response;
    }
public function executeAsync(ClientRequestInterface $request, array $headers = null, array $clientOptions = [])
    {
        if ($request instanceof ContextAwareInterface) {
            $request->setContextIfNull($this->getConfig()->getContext());
        }
        $httpRequest = $this->createHttpRequest($request, $headers);
        $client = $this->getHttpClient();
        if ($client instanceof AdapterOptionInterface) {
            $response = $request->buildResponse($client->executeAsync($httpRequest, $clientOptions));
        } else {
            $response = $request->buildResponse($client->executeAsync($httpRequest));
        }

        $response = $response->then(
            function ($httpResponse) use ($httpRequest) {
                $this->logDeprecatedRequest($httpResponse, $httpRequest);
                return $httpResponse;
            }
        );

        return $response;
    }
public function executeAsync ( ClientRequestInterface $ request , array $ headers = null , array $ clientOptions = [ ] ) { if ( $ request instanceof ContextAwareInterface ) { $ request -> setContextIfNull ( $ this -> getConfig ( ) -> getContext ( ) ) ; } $ httpRequest = $ this -> createHttpRequest ( $ request , $ headers ) ; $ client = $ this -> getHttpClient ( ) ; if ( $ client instanceof AdapterOptionInterface ) { $ response = $ request -> buildResponse ( $ client -> executeAsync ( $ httpRequest , $ clientOptions ) ) ; } else { $ response = $ request -> buildResponse ( $ client -> executeAsync ( $ httpRequest ) ) ; } $ response = $ response -> then ( function ( $ httpResponse ) use ( $ httpRequest ) { $ this -> logDeprecatedRequest ( $ httpResponse , $ httpRequest ) ; return $ httpResponse ; } ) ; return $ response ; }
Executes an API request asynchronously
@param ClientRequestInterface $request
@param array $clientOptions
@return ApiResponseInterface
Executes an API request asynchronously