Package com.commercetools.http.asynchttp
Class CtAsyncHttpClient
java.lang.Object
io.vrap.rmf.base.client.HttpClientBase
com.commercetools.http.asynchttp.CtAsyncHttpClient
- All Implemented Interfaces:
VrapHttpClient
,Closeable
,AutoCloseable
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUses aThrottleRequestFilter
to limit the number of concurrent requestsCtAsyncHttpClient
(int maxConnections) Uses aThrottleRequestFilter
to limit the number of concurrent requestsCtAsyncHttpClient
(int maxConnections, BuilderOptions options) Uses aThrottleRequestFilter
to limit the number of concurrent requestsCtAsyncHttpClient
(BuilderOptions options) creates a default instance of the AsyncHttpClientCtAsyncHttpClient
(ExecutorService executor) creates a default instance of the AsyncHttpClientCtAsyncHttpClient
(ExecutorService executor, int maxConnections) Uses aThrottleRequestFilter
to limit the number of concurrent requestsCtAsyncHttpClient
(ExecutorService executor, int maxConnections, BuilderOptions options) Uses aThrottleRequestFilter
to limit the number of concurrent requestsCtAsyncHttpClient
(ExecutorService executor, BuilderOptions options) creates a default instance of the AsyncHttpClientCtAsyncHttpClient
(ExecutorService executor, Supplier<org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder> builderSupplier) creates a instance of the AsyncHttpClient using the provided builderCtAsyncHttpClient
(Supplier<org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder> builderSupplier) creates a instance of the AsyncHttpClient using the provided builder -
Method Summary
Modifier and TypeMethodDescriptionvoid
closes the underlying HTTP clientstatic org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder
CompletableFuture<ApiHttpResponse<byte[]>>
execute
(ApiHttpRequest httpRequest) executes a requestMethods inherited from class io.vrap.rmf.base.client.HttpClientBase
close
-
Field Details
-
MAX_REQUESTS
public static final int MAX_REQUESTS- See Also:
-
-
Constructor Details
-
CtAsyncHttpClient
public CtAsyncHttpClient()Uses aThrottleRequestFilter
to limit the number of concurrent requests -
CtAsyncHttpClient
public CtAsyncHttpClient(int maxConnections) Uses aThrottleRequestFilter
to limit the number of concurrent requests- Parameters:
maxConnections
- maximum number of parallel connections
-
CtAsyncHttpClient
creates a default instance of the AsyncHttpClient- Parameters:
options
- options to build the underlying HTTP client
-
CtAsyncHttpClient
Uses aThrottleRequestFilter
to limit the number of concurrent requests- Parameters:
maxConnections
- maximum number of parallel connectionsoptions
- options to build the underlying HTTP client
-
CtAsyncHttpClient
public CtAsyncHttpClient(Supplier<org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder> builderSupplier) creates a instance of the AsyncHttpClient using the provided builder- Parameters:
builderSupplier
- builder with the configuration of the underlying HTTP client
-
CtAsyncHttpClient
creates a default instance of the AsyncHttpClient- Parameters:
executor
- ExecutorService to be used for the client
-
CtAsyncHttpClient
Uses aThrottleRequestFilter
to limit the number of concurrent requests- Parameters:
maxConnections
- maximum number of parallel connectionsexecutor
- ExecutorService to be used
-
CtAsyncHttpClient
creates a default instance of the AsyncHttpClient- Parameters:
executor
- ExecutorService to be used for the clientoptions
- options to build the underlying HTTP client
-
CtAsyncHttpClient
Uses aThrottleRequestFilter
to limit the number of concurrent requests- Parameters:
maxConnections
- maximum number of parallel connectionsexecutor
- ExecutorService to be usedoptions
- options to build the underlying HTTP client
-
CtAsyncHttpClient
public CtAsyncHttpClient(ExecutorService executor, Supplier<org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder> builderSupplier) creates a instance of the AsyncHttpClient using the provided builder- Parameters:
executor
- ExecutorService to be usedbuilderSupplier
- builder with the configuration of the underlying HTTP client
-
-
Method Details
-
createClientBuilder
public static org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder createClientBuilder() -
execute
executes a request- Specified by:
execute
in interfaceVrapHttpClient
- Parameters:
httpRequest
- request to be executed- Returns:
- response future
-
closeDelegate
closes the underlying HTTP client- Throws:
Exception
- in case of failure closing the client
-