public interface StreamingHttpConnection extends FilterableStreamingHttpConnection, GracefulAutoCloseable
HttpConnection
but that accepts StreamingHttpRequest
and returns
StreamingHttpResponse
.Modifier and Type | Method and Description |
---|---|
BlockingHttpConnection |
asBlockingConnection()
Convert this
StreamingHttpConnection to the BlockingHttpConnection API. |
BlockingStreamingHttpConnection |
asBlockingStreamingConnection()
Convert this
StreamingHttpConnection to the BlockingStreamingHttpConnection API. |
HttpConnection |
asConnection()
Convert this
StreamingHttpConnection to the HttpConnection API. |
default void |
close() |
default void |
closeGracefully()
Used to close/shutdown a resource, similar to
AutoCloseable.close() , but attempts to cleanup state before
abruptly closing. |
Single<StreamingHttpResponse> |
request(StreamingHttpRequest request)
Send a
request . |
connectionContext, transportEventStream
executionContext, httpResponseFactory, request
connect, delete, get, head, newRequest, options, patch, post, trace
onClose
closeAsync, closeAsyncGracefully
Single<StreamingHttpResponse> request(StreamingHttpRequest request)
request
.request
- the request to send.HttpConnection asConnection()
StreamingHttpConnection
to the HttpConnection
API.
This API is provided for convenience. It is recommended that
filters are implemented using the StreamingHttpConnection
asynchronous API for maximum portability.
HttpConnection
representation of this StreamingHttpConnection
.BlockingStreamingHttpConnection asBlockingStreamingConnection()
StreamingHttpConnection
to the BlockingStreamingHttpConnection
API.
This API is provided for convenience for a more familiar sequential programming model. It is recommended that
filters are implemented using the StreamingHttpConnection
asynchronous API for maximum portability.
BlockingStreamingHttpConnection
representation of this StreamingHttpConnection
.BlockingHttpConnection asBlockingConnection()
StreamingHttpConnection
to the BlockingHttpConnection
API.
This API is provided for convenience for a more familiar sequential programming model. It is recommended that
filters are implemented using the StreamingHttpConnection
asynchronous API for maximum portability.
BlockingHttpConnection
representation of this StreamingHttpConnection
.default void close() throws java.lang.Exception
close
in interface java.lang.AutoCloseable
java.lang.Exception
default void closeGracefully() throws java.lang.Exception
GracefulAutoCloseable
AutoCloseable.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 to AutoCloseable.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()
.
closeGracefully
in interface GracefulAutoCloseable
java.lang.Exception
- if graceful closure failed.