public final class ConcurrencyLimitingHttpClient extends ConcurrencyLimitingClient<HttpRequest,HttpResponse> implements HttpClient
HttpClient decorator that limits the concurrent number of active HTTP requests.
For example:
ClientBuilder builder = new ClientBuilder(...);
builder.decorator(ConcurrencyLimitingHttpClient.newDecorator(16));
client = builder.build(...);
ConcurrencyLimitingClient.Deferred<O extends Response>| Modifier and Type | Method and Description |
|---|---|
protected ConcurrencyLimitingClient.Deferred<HttpResponse> |
defer(ClientRequestContext ctx,
HttpRequest req)
Defers the specified
Request. |
static Function<? super HttpClient,ConcurrencyLimitingHttpClient> |
newDecorator(int maxConcurrency)
Creates a new
HttpClient decorator that limits the concurrent number of active HTTP requests. |
static Function<? super HttpClient,ConcurrencyLimitingHttpClient> |
newDecorator(int maxConcurrency,
long timeout,
TimeUnit unit)
Creates a new
HttpClient decorator that limits the concurrent number of active HTTP requests. |
execute, numActiveRequestsas, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecutepublic static Function<? super HttpClient,ConcurrencyLimitingHttpClient> newDecorator(int maxConcurrency)
HttpClient decorator that limits the concurrent number of active HTTP requests.public static Function<? super HttpClient,ConcurrencyLimitingHttpClient> newDecorator(int maxConcurrency, long timeout, TimeUnit unit)
HttpClient decorator that limits the concurrent number of active HTTP requests.protected ConcurrencyLimitingClient.Deferred<HttpResponse> defer(ClientRequestContext ctx, HttpRequest req) throws Exception
ConcurrencyLimitingClientRequest.defer in class ConcurrencyLimitingClient<HttpRequest,HttpResponse>ConcurrencyLimitingClient.Deferred which provides the interface for updating the result of
Request execution later.ExceptionCopyright © 2020 LeanCloud. All rights reserved.