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 BlockingHttpClientConvert thisBlockingStreamingHttpClientto theBlockingHttpClientAPI.default HttpClientasClient()Convert thisBlockingStreamingHttpClientto theHttpClientAPI.Convert thisBlockingStreamingHttpClientto theStreamingHttpClientAPI.reserveConnection(HttpRequestMetaData metaData) Reserve aBlockingStreamingHttpConnectionbased on providedHttpRequestMetaData.Methods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequester
close, executionContext, httpResponseFactory, requestMethods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequestFactory
connect, delete, get, head, newRequest, options, patch, post, put, traceMethods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
Method Details
-
reserveConnection
ReservedBlockingStreamingHttpConnection reserveConnection(HttpRequestMetaData metaData) throws Exception Reserve aBlockingStreamingHttpConnectionbased on providedHttpRequestMetaData.If a new connection should be opened instead of potentially reusing an already established one, the
HttpContextKeys.HTTP_FORCE_NEW_CONNECTIONmust be set.- Parameters:
metaData- Allows the underlying layers to know whatBlockingStreamingHttpConnections are valid to reserve for futurerequestswith 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 thisBlockingStreamingHttpClientto theStreamingHttpClientAPI.Note that the resulting
StreamingHttpClientmay still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient.- Returns:
- a
StreamingHttpClientrepresentation of thisBlockingStreamingHttpClient.
-
asClient
Convert thisBlockingStreamingHttpClientto theHttpClientAPI.Note that the resulting
HttpClientmay still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient.- Returns:
- a
HttpClientrepresentation of thisBlockingStreamingHttpClient.
-
asBlockingClient
Convert thisBlockingStreamingHttpClientto theBlockingHttpClientAPI.Note that the resulting
BlockingHttpClientmay still be subject to in memory aggregation and other behavior as thisBlockingStreamingHttpClient.- Returns:
- a
BlockingHttpClientrepresentation of thisBlockingStreamingHttpClient.
-