Package io.servicetalk.http.api
Interface StreamingHttpRequester
- All Superinterfaces:
AsyncCloseable,AutoCloseable,GracefulAutoCloseable,ListenableAsyncCloseable,StreamingHttpRequestFactory
- All Known Subinterfaces:
FilterableReservedStreamingHttpConnection,FilterableStreamingHttpClient,FilterableStreamingHttpConnection,FilterableStreamingHttpLoadBalancedConnection,ReservedStreamingHttpConnection,StreamingHttpClient,StreamingHttpConnection
- All Known Implementing Classes:
DelegatingFilterableStreamingHttpLoadBalancedConnection,HttpLoadBalancerFactory.DefaultFilterableStreamingHttpLoadBalancedConnection,ReservedStreamingHttpConnectionFilter,StreamingHttpClientFilter,StreamingHttpConnectionFilter
public interface StreamingHttpRequester
extends StreamingHttpRequestFactory, ListenableAsyncCloseable, GracefulAutoCloseable
The equivalent of
HttpRequester but that accepts StreamingHttpRequest and returns
StreamingHttpResponse.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()default voidUsed to close/shutdown a resource, similar toAutoCloseable.close(), but attempts to cleanup state before abruptly closing.Get theHttpExecutionContextused during construction of this object.Get aStreamingHttpResponseFactory.request(StreamingHttpRequest request) Send arequest.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose, onClosing
-
Method Details
-
request
Send arequest.- Parameters:
request- the request to send.- Returns:
- The response.
-
executionContext
HttpExecutionContext executionContext()Get theHttpExecutionContextused during construction of this object.Note that the
ExecutionContext.ioExecutor()will not necessarily be associated with a specific thread unless that was how this object was built.- Returns:
- the
HttpExecutionContextused during construction of this object.
-
httpResponseFactory
StreamingHttpResponseFactory httpResponseFactory()Get aStreamingHttpResponseFactory.- Returns:
- a
StreamingHttpResponseFactory.
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
closeGracefully
Description copied from interface:GracefulAutoCloseableUsed to close/shutdown a resource, similar toAutoCloseable.close(), but attempts to cleanup state before abruptly closing. This provides a hint that implementations can use to stop accepting new work and finish in flight work. This method is implemented on a "best effort" basis and may be equivalent toAutoCloseable.close().Note: Implementations may or may not apply a timeout for this operation to complete, if a caller does not want to wait indefinitely, and are unsure if the implementation applies a timeout, it is advisable to apply a timeout and force a call to
AutoCloseable.close().- Specified by:
closeGracefullyin interfaceGracefulAutoCloseable- Throws:
Exception- if graceful closure failed.
-