Package io.servicetalk.http.api
Interface BlockingHttpConnection
-
- All Superinterfaces:
java.lang.AutoCloseable
,BlockingHttpRequester
,GracefulAutoCloseable
,HttpRequestFactory
- All Known Subinterfaces:
ReservedBlockingHttpConnection
public interface BlockingHttpConnection extends BlockingHttpRequester
The equivalent ofHttpConnection
but with synchronous/blocking APIs instead of asynchronous APIs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BlockingStreamingHttpConnection
asBlockingStreamingConnection()
Convert thisBlockingHttpConnection
to theBlockingStreamingHttpConnection
API.default HttpConnection
asConnection()
Convert thisBlockingHttpConnection
to theHttpConnection
API.StreamingHttpConnection
asStreamingConnection()
Convert thisBlockingHttpConnection
to theStreamingHttpConnection
API.HttpConnectionContext
connectionContext()
Get theHttpConnectionContext
.HttpResponse
request(HttpRequest request)
Send arequest
.<T> BlockingIterable<? extends T>
transportEventIterable(HttpEventKey<T> eventKey)
Returns aBlockingIterable
that gives the current value of the setting as well as subsequent changes to the setting value as long as thePublisherSource.Subscriber
has expressed enough demand.-
Methods inherited from interface io.servicetalk.http.api.BlockingHttpRequester
close, executionContext, httpResponseFactory, request
-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
request
HttpResponse request(HttpRequest request) throws java.lang.Exception
Send arequest
.- Parameters:
request
- the request to send.- Returns:
- The response.
- Throws:
java.lang.Exception
- if an exception occurs during the request processing.
-
connectionContext
HttpConnectionContext connectionContext()
Get theHttpConnectionContext
.- Returns:
- the
HttpConnectionContext
.
-
transportEventIterable
<T> BlockingIterable<? extends T> transportEventIterable(HttpEventKey<T> eventKey)
Returns aBlockingIterable
that gives the current value of the setting as well as subsequent changes to the setting value as long as thePublisherSource.Subscriber
has expressed enough demand.This is designed for events produced by the transport, and consumed by filters interested in transport behavior which is not directly involved in the data path.
- Type Parameters:
T
- Type of the setting value.- Parameters:
eventKey
- Name of the event to fetch.- Returns:
BlockingIterable
for the setting values.
-
asStreamingConnection
StreamingHttpConnection asStreamingConnection()
Convert thisBlockingHttpConnection
to theStreamingHttpConnection
API.Note that the resulting
StreamingHttpConnection
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingHttpConnection
.- Returns:
- a
StreamingHttpConnection
representation of thisBlockingHttpConnection
.
-
asConnection
default HttpConnection asConnection()
Convert thisBlockingHttpConnection
to theHttpConnection
API.Note that the resulting
HttpConnection
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingHttpConnection
.- Returns:
- a
HttpConnection
representation of thisBlockingHttpConnection
.
-
asBlockingStreamingConnection
default BlockingStreamingHttpConnection asBlockingStreamingConnection()
Convert thisBlockingHttpConnection
to theBlockingStreamingHttpConnection
API.Note that the resulting
BlockingStreamingHttpConnection
may still be subject to in memory aggregation and other behavior as thisBlockingHttpConnection
.- Returns:
- a
BlockingStreamingHttpConnection
representation of thisBlockingHttpConnection
.
-
-