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 ofHttpConnectionbut with synchronous/blocking APIs instead of asynchronous APIs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BlockingStreamingHttpConnectionasBlockingStreamingConnection()Convert thisBlockingHttpConnectionto theBlockingStreamingHttpConnectionAPI.default HttpConnectionasConnection()Convert thisBlockingHttpConnectionto theHttpConnectionAPI.StreamingHttpConnectionasStreamingConnection()Convert thisBlockingHttpConnectionto theStreamingHttpConnectionAPI.HttpConnectionContextconnectionContext()Get theHttpConnectionContext.HttpResponserequest(HttpRequest request)Send arequest.<T> BlockingIterable<? extends T>transportEventIterable(HttpEventKey<T> eventKey)Returns aBlockingIterablethat gives the current value of the setting as well as subsequent changes to the setting value as long as thePublisherSource.Subscriberhas 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 aBlockingIterablethat gives the current value of the setting as well as subsequent changes to the setting value as long as thePublisherSource.Subscriberhas 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:
BlockingIterablefor the setting values.
-
asStreamingConnection
StreamingHttpConnection asStreamingConnection()
Convert thisBlockingHttpConnectionto theStreamingHttpConnectionAPI.Note that the resulting
StreamingHttpConnectionmay still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingHttpConnection.- Returns:
- a
StreamingHttpConnectionrepresentation of thisBlockingHttpConnection.
-
asConnection
default HttpConnection asConnection()
Convert thisBlockingHttpConnectionto theHttpConnectionAPI.Note that the resulting
HttpConnectionmay still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingHttpConnection.- Returns:
- a
HttpConnectionrepresentation of thisBlockingHttpConnection.
-
asBlockingStreamingConnection
default BlockingStreamingHttpConnection asBlockingStreamingConnection()
Convert thisBlockingHttpConnectionto theBlockingStreamingHttpConnectionAPI.Note that the resulting
BlockingStreamingHttpConnectionmay still be subject to in memory aggregation and other behavior as thisBlockingHttpConnection.- Returns:
- a
BlockingStreamingHttpConnectionrepresentation of thisBlockingHttpConnection.
-
-