Package io.servicetalk.http.api
Interface BlockingStreamingHttpClient
- All Superinterfaces:
AutoCloseable
,BlockingStreamingHttpRequester
,BlockingStreamingHttpRequestFactory
,GracefulAutoCloseable
The equivalent of
StreamingHttpClient
but with synchronous/blocking APIs instead of asynchronous APIs.-
Method Summary
Modifier and TypeMethodDescriptiondefault BlockingHttpClient
Convert thisBlockingStreamingHttpClient
to theBlockingHttpClient
API.default HttpClient
asClient()
Convert thisBlockingStreamingHttpClient
to theHttpClient
API.Convert thisBlockingStreamingHttpClient
to theStreamingHttpClient
API.reserveConnection
(HttpRequestMetaData metaData) Reserve aBlockingStreamingHttpConnection
based on providedHttpRequestMetaData
.Methods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequester
close, executionContext, httpResponseFactory, request
Methods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequestFactory
connect, delete, get, head, newRequest, options, patch, post, put, trace
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
Method Details
-
reserveConnection
ReservedBlockingStreamingHttpConnection reserveConnection(HttpRequestMetaData metaData) throws Exception Reserve aBlockingStreamingHttpConnection
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 whatBlockingStreamingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingStreamingHttpConnection
. - Throws:
Exception
- if a exception occurs during the reservation process.- See Also:
-
asStreamingClient
StreamingHttpClient asStreamingClient()Convert thisBlockingStreamingHttpClient
to theStreamingHttpClient
API.Note that the resulting
StreamingHttpClient
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
StreamingHttpClient
representation of thisBlockingStreamingHttpClient
.
-
asClient
Convert thisBlockingStreamingHttpClient
to theHttpClient
API.Note that the resulting
HttpClient
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
HttpClient
representation of thisBlockingStreamingHttpClient
.
-
asBlockingClient
Convert thisBlockingStreamingHttpClient
to theBlockingHttpClient
API.Note that the resulting
BlockingHttpClient
may still be subject to in memory aggregation and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
BlockingHttpClient
representation of thisBlockingStreamingHttpClient
.
-