Documentation

HttpClientPool
in package
implements HttpClientPool

AbstractYes

A http client pool allows to send requests on a pool of different http client using a specific strategy (least used, round robin, ...).

Table of Contents

Interfaces

HttpClientPool
A http client pool allows to send requests on a pool of different http client using a specific strategy (least used, round robin, ...).

Properties

$clientPool  : array<string|int, HttpClientPoolItem>

Methods

addHttpClient()  : void
Add a client to the pool.
sendAsyncRequest()  : Promise
Sends a PSR-7 request in an asynchronous way.
sendRequest()  : ResponseInterface
Sends a PSR-7 request and returns a PSR-7 response.
chooseHttpClient()  : HttpClientPoolItem
Return an http client given a specific strategy.

Properties

$clientPool

protected array<string|int, HttpClientPoolItem> $clientPool = []

Methods

chooseHttpClient()

Return an http client given a specific strategy.

protected abstract chooseHttpClient() : HttpClientPoolItem
Tags
throws
HttpClientNotFoundException

When no http client has been found into the pool

Return values
HttpClientPoolItem

Return a http client that can do both sync or async


        
On this page

Search results