Documentation

LeastUsedClientPool extends HttpClientPool
in package

FinalYes

LeastUsedClientPool will choose the client with the less current request in the pool.

This strategy is only useful when doing async request

Tags
author

Joel Wurtz joel.wurtz@gmail.com

Table of Contents

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 chooseHttpClient() : HttpClientPoolItem
Return values
HttpClientPoolItem

Return a http client that can do both sync or async


        
On this page

Search results