src/Client.php
/**
     * Execute all requests in the pool
     *
     * @return Response\BaseResponse[]|mixed[]
     *
     * @throws QuotaExceededException If the maximum number of calls per second exceeded
     * @throws Exception If the response cannot be parsed
     *
     * @see Client::$useBatching
     */
Execute all requests in the pool
@return Response\BaseResponse[]|mixed[]

@throws QuotaExceededException If the maximum number of calls per second exceeded
@throws Exception If the response cannot be parsed

@see Client::$useBatching
Execute all requests in the pool @return Response \ BaseResponse [] |mixed [] @throws QuotaExceededException If the maximum number of calls per second exceeded @throws Exception If the response cannot be parsed @see Client :: $useBatching
public function executeBatch()
    {
        $responses = [];
        if ($this->getPoolSize() > 0) {
            $this->logger->info(sprintf('Performing batch request for %s requests in the pool', $this->getPoolSize()));
            $boundaries = [];
            foreach ($this->requestPool as $_request) {
                $boundaries[] = $this->requestToBoundary($_request['requestFactory']());
            }
            $boundary = "--batch\r\n";
            $boundary .= implode("\r\n--batch\r\n", $boundaries);
            $boundary .= "\r\n--batch--\r\n";
            $request = $this->createRequest('POST', 'batch', [
                'headers' => [
                    'Content-Type' => 'multipart/mixed; boundary="batch"',
                    'Mime-Version' => '1.0',
                ],
                'body' => $boundary
            ]);
            $responses = $this->internalRequest(null, function () use ($request) {
                return $request;
            }, true);
            $this->requestPool = [];
        }
        return $responses;
    }
public function executeBatch ( ) { $ responses = [ ] ; if ( $ this -> getPoolSize ( ) > 0 ) { $ this -> logger -> info ( sprintf ( 'Performing batch request for %s requests in the pool' , $ this -> getPoolSize ( ) ) ) ; $ boundaries = [ ] ; foreach ( $ this -> requestPool as $ _request ) { $ boundaries [ ] = $ this -> requestToBoundary ( $ _request [ 'requestFactory' ] ( ) ) ; } $ boundary = " --batch \r \n " ; $ boundary .= implode ( " \r \n --batch \r \n " , $ boundaries ) ; $ boundary .= " \r \n --batch-- \r \n " ; $ request = $ this -> createRequest ( 'POST' , 'batch' , [ 'headers' => [ 'Content-Type' => 'multipart/mixed; boundary="batch"' , 'Mime-Version' => '1.0' , ] , 'body' => $ boundary ] ) ; $ responses = $ this -> internalRequest ( null , function ( ) use ( $ request ) { return $ request ; } , true ) ; $ this -> requestPool = [ ] ; } return $ responses ; }
Execute all requests in the pool
 @return Response\BaseResponse[]|mixed[]
Execute all requests in the pool @return Response \ BaseResponse [] |mixed []