Package io.servicetalk.http.api
Interface BlockingHttpClient
- All Superinterfaces:
AutoCloseable
,BlockingHttpRequester
,GracefulAutoCloseable
,HttpRequestFactory
The equivalent of
HttpClient
but with synchronous/blocking APIs instead of asynchronous APIs.-
Method Summary
Modifier and TypeMethodDescriptiondefault BlockingStreamingHttpClient
Convert thisBlockingHttpClient
to theBlockingStreamingHttpClient
API.default HttpClient
asClient()
Convert thisBlockingHttpClient
to theHttpClient
API.Convert thisBlockingHttpClient
to theStreamingHttpClient
API.reserveConnection
(HttpRequestMetaData metaData) Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.Methods inherited from interface io.servicetalk.http.api.BlockingHttpRequester
close, executionContext, httpResponseFactory, request
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
Method Details
-
reserveConnection
Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.If a new connection should be opened instead of potentially reusing an already established one, the
HttpContextKeys.HTTP_FORCE_NEW_CONNECTION
must be set.- Parameters:
metaData
- Allows the underlying layers to know whatBlockingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingHttpConnection
. - Throws:
Exception
- if a exception occurs during the reservation process.- See Also:
-
asStreamingClient
StreamingHttpClient asStreamingClient()Convert thisBlockingHttpClient
to theStreamingHttpClient
API.- Returns:
- a
StreamingHttpClient
representation of thisBlockingHttpClient
.
-
asClient
Convert thisBlockingHttpClient
to theHttpClient
API.- Returns:
- a
HttpClient
representation of thisBlockingHttpClient
.
-
asBlockingStreamingClient
Convert thisBlockingHttpClient
to theBlockingStreamingHttpClient
API.- Returns:
- a
BlockingStreamingHttpClient
representation of thisBlockingHttpClient
.
-