public interface HttpClient extends HttpRequester, GracefulAutoCloseable
HttpConnection instances and distribute calls to request(HttpRequest) amongst this collection.| Modifier and Type | Method and Description |
|---|---|
default BlockingHttpClient |
asBlockingClient()
Convert this
HttpClient to the BlockingHttpClient API. |
default BlockingStreamingHttpClient |
asBlockingStreamingClient()
Convert this
HttpClient to the BlockingStreamingHttpClient API. |
StreamingHttpClient |
asStreamingClient()
Convert this
HttpClient to the StreamingHttpClient API. |
default void |
close() |
default void |
closeGracefully() |
Single<HttpResponse> |
request(HttpRequest request)
Send a
request. |
Single<ReservedHttpConnection> |
reserveConnection(HttpExecutionStrategy strategy,
HttpRequestMetaData metaData)
Reserve an
HttpConnection based on provided HttpRequestMetaData. |
Single<ReservedHttpConnection> |
reserveConnection(HttpRequestMetaData metaData)
Reserve an
HttpConnection based on provided HttpRequestMetaData. |
executionContext, httpResponseFactory, requestSingle<HttpResponse> request(HttpRequest request)
request.request - the request to send.Single<ReservedHttpConnection> reserveConnection(HttpRequestMetaData metaData)
HttpConnection based on provided HttpRequestMetaData.metaData - Allows the underlying layers to know what HttpConnections are valid to
reserve for future requests with the same HttpRequestMetaData.
For example this may provide some insight into shard or other info.Single that provides the ReservedHttpConnection upon completion.Single<ReservedHttpConnection> reserveConnection(HttpExecutionStrategy strategy, HttpRequestMetaData metaData)
HttpConnection based on provided HttpRequestMetaData.
Note: reserved connections may not be restricted by the max pipelined requests count.
strategy - HttpExecutionStrategy to use.metaData - Allows the underlying layers to know what HttpConnections are valid to
reserve for future requests with the same HttpRequestMetaData.
For example this may provide some insight into shard or other info.Single that provides the ReservedHttpConnection upon completion.StreamingHttpClient asStreamingClient()
HttpClient to the StreamingHttpClient API.StreamingHttpClient representation of this HttpClient.default BlockingStreamingHttpClient asBlockingStreamingClient()
HttpClient to the BlockingStreamingHttpClient API.BlockingStreamingHttpClient representation of this HttpClient.default BlockingHttpClient asBlockingClient()
HttpClient to the BlockingHttpClient API.BlockingHttpClient representation of this HttpClient.default void close()
throws Exception
close in interface AutoCloseableExceptiondefault void closeGracefully()
throws Exception
closeGracefully in interface GracefulAutoCloseableException