Package io.servicetalk.http.api
Interface StreamingHttpClient
- All Superinterfaces:
AsyncCloseable,AutoCloseable,FilterableStreamingHttpClient,GracefulAutoCloseable,ListenableAsyncCloseable,StreamingHttpRequester,StreamingHttpRequestFactory
The equivalent of
HttpClient but that accepts StreamingHttpRequest and returns
StreamingHttpResponse.-
Method Summary
Modifier and TypeMethodDescriptionConvert thisStreamingHttpClientto theBlockingHttpClientAPI.Convert thisStreamingHttpClientto theBlockingStreamingHttpClientAPI.asClient()Convert thisStreamingHttpClientto theHttpClientAPI.reserveConnection(HttpRequestMetaData metaData) Reserve aStreamingHttpConnectionbased on providedHttpRequestMetaData.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosingMethods inherited from interface io.servicetalk.http.api.StreamingHttpRequester
close, closeGracefully, executionContext, httpResponseFactory, request
-
Method Details
-
reserveConnection
Reserve aStreamingHttpConnectionbased 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.- Specified by:
reserveConnectionin interfaceFilterableStreamingHttpClient- Parameters:
metaData- Allows the underlying layers to know whatStreamingHttpConnections are valid to reserve for futurerequestswith the sameHttpRequestMetaData. For example this may provide some insight into shard or other info.- Returns:
- a
Singlethat provides theReservedStreamingHttpConnectionupon completion. - See Also:
-
asClient
HttpClient asClient()Convert thisStreamingHttpClientto theHttpClientAPI.This API is provided for convenience. It is recommended that filters are implemented using the
StreamingHttpClientasynchronous API for maximum portability.- Returns:
- a
HttpClientrepresentation of thisStreamingHttpRequester.
-
asBlockingStreamingClient
BlockingStreamingHttpClient asBlockingStreamingClient()Convert thisStreamingHttpClientto theBlockingStreamingHttpClientAPI.This API is provided for convenience for a more familiar sequential programming model. It is recommended that filters are implemented using the
StreamingHttpClientasynchronous API for maximum portability.- Returns:
- a
BlockingStreamingHttpClientrepresentation of thisStreamingHttpClient.
-
asBlockingClient
BlockingHttpClient asBlockingClient()Convert thisStreamingHttpClientto theBlockingHttpClientAPI.This API is provided for convenience for a more familiar sequential programming model. It is recommended that filters are implemented using the
StreamingHttpClientasynchronous API for maximum portability.- Returns:
- a
BlockingHttpClientrepresentation of thisStreamingHttpClient.
-