AsyncHttpClient

class Firstred\PostNL\HttpClient\AsyncHttpClient
Class AsyncHttpClient.
Parent:

Firstred\PostNL\HttpClient\BaseHttpClient

Implements:

Firstred\PostNL\HttpClient\HttpClientInterface

Summary

Methods

Properties

protected property Firstred\PostNL\HttpClient\AsyncHttpClient::$instance
Type:

static

protected static property Firstred\PostNL\HttpClient\AsyncHttpClient::$client
Type:

\Http\Client\HttpAsyncClient

Methods

public Firstred\PostNL\HttpClient\AsyncHttpClient::__construct($client=null, $logger=null, $concurrency=5, $maxRetries=5)
HTTPlugClient constructor.
Parameters:
  • $client (Http\Client\HttpAsyncClient | null)

  • $logger (Psr\Log\LoggerInterface | null)

  • $concurrency (int)

  • $maxRetries (int)

Throws:

\Firstred\PostNL\Exception\HttpClientException

Since:

1.0.0

Since:

1.0.0

public Firstred\PostNL\HttpClient\AsyncHttpClient::doRequests( $requests=\[\])
Do all async requests.
Exceptions are captured into the result array
Parameters:
  • $requests (Psr\Http\Message\RequestInterface[])

Returns:

\Firstred\PostNL\Exception\HttpClientException[] | \Psr\Http\Message\ResponseInterface[]

Throws:

\Firstred\PostNL\Exception\InvalidArgumentException

public Firstred\PostNL\HttpClient\AsyncHttpClient::doRequest($request)
Do a single request.
Exceptions are captured into the result array
Parameters:
  • $request (Psr\Http\Message\RequestInterface)

Returns:

\Psr\Http\Message\ResponseInterface

Throws:

\Firstred\PostNL\Exception\HttpClientException

public Firstred\PostNL\HttpClient\AsyncHttpClient::getClient()
Returns:

\Http\Client\HttpAsyncClient

public Firstred\PostNL\HttpClient\AsyncHttpClient::setClient($client)
Parameters:
  • $client (Http\Client\HttpAsyncClient)

Returns:

static