Class AbstractConcurrencyLimitingClient<I extends Request,​O extends Response>

java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Client<T_I,​T_O>>
com.linecorp.armeria.client.DecoratingClient<I,​O,​I,​O>
com.linecorp.armeria.client.SimpleDecoratingClient<I,​O>
com.linecorp.armeria.client.limit.AbstractConcurrencyLimitingClient<I,​O>
Type Parameters:
I - the Request type
O - the Response type
All Implemented Interfaces:
Client<I,​O>, Unwrappable
Direct Known Subclasses:
ConcurrencyLimitingClient

public abstract class AbstractConcurrencyLimitingClient<I extends Request,​O extends Response>
extends SimpleDecoratingClient<I,​O>
An abstract Client decorator that limits the concurrent number of active requests.

numActiveRequests() increases when Client.execute(ClientRequestContext, Request) is invoked and decreases when the Response returned by the Client.execute(ClientRequestContext, Request) is closed. When numActiveRequests() reaches at the configured maxConcurrency the Requests are deferred until the currently active Requests are completed.