Package io.servicetalk.http.api
Interface BlockingStreamingHttpClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,BlockingStreamingHttpRequester
,BlockingStreamingHttpRequestFactory
,GracefulAutoCloseable
public interface BlockingStreamingHttpClient extends BlockingStreamingHttpRequester
The equivalent ofStreamingHttpClient
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 BlockingHttpClient
asBlockingClient()
Convert thisBlockingStreamingHttpClient
to theBlockingHttpClient
API.default HttpClient
asClient()
Convert thisBlockingStreamingHttpClient
to theHttpClient
API.StreamingHttpClient
asStreamingClient()
Convert thisBlockingStreamingHttpClient
to theStreamingHttpClient
API.BlockingStreamingHttpResponse
request(BlockingStreamingHttpRequest request)
Send arequest
.ReservedBlockingStreamingHttpConnection
reserveConnection(HttpExecutionStrategy strategy, HttpRequestMetaData metaData)
Reserve aBlockingStreamingHttpConnection
based on providedHttpRequestMetaData
.ReservedBlockingStreamingHttpConnection
reserveConnection(HttpRequestMetaData metaData)
Reserve aBlockingStreamingHttpConnection
based on providedHttpRequestMetaData
.-
Methods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequester
close, executionContext, httpResponseFactory, request
-
Methods inherited from interface io.servicetalk.http.api.BlockingStreamingHttpRequestFactory
connect, delete, get, head, newRequest, options, patch, post, put, trace
-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
request
BlockingStreamingHttpResponse request(BlockingStreamingHttpRequest 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.
-
reserveConnection
ReservedBlockingStreamingHttpConnection reserveConnection(HttpRequestMetaData metaData) throws java.lang.Exception
Reserve aBlockingStreamingHttpConnection
based on providedHttpRequestMetaData
.- Parameters:
metaData
- Allows the underlying layers to know whatBlockingStreamingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingStreamingHttpConnection
. - Throws:
java.lang.Exception
- if a exception occurs during the reservation process.
-
reserveConnection
ReservedBlockingStreamingHttpConnection reserveConnection(HttpExecutionStrategy strategy, HttpRequestMetaData metaData) throws java.lang.Exception
Reserve aBlockingStreamingHttpConnection
based on providedHttpRequestMetaData
.- Parameters:
strategy
-HttpExecutionStrategy
to use.metaData
- Allows the underlying layers to know whatBlockingStreamingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingStreamingHttpConnection
. - Throws:
java.lang.Exception
- if a exception occurs during the reservation process.
-
asStreamingClient
StreamingHttpClient asStreamingClient()
Convert thisBlockingStreamingHttpClient
to theStreamingHttpClient
API.Note that the resulting
StreamingHttpClient
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
StreamingHttpClient
representation of thisBlockingStreamingHttpClient
.
-
asClient
default HttpClient asClient()
Convert thisBlockingStreamingHttpClient
to theHttpClient
API.Note that the resulting
HttpClient
may still be subject to any blocking, in memory aggregation, and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
HttpClient
representation of thisBlockingStreamingHttpClient
.
-
asBlockingClient
default BlockingHttpClient asBlockingClient()
Convert thisBlockingStreamingHttpClient
to theBlockingHttpClient
API.Note that the resulting
BlockingHttpClient
may still be subject to in memory aggregation and other behavior as thisBlockingStreamingHttpClient
.- Returns:
- a
BlockingHttpClient
representation of thisBlockingStreamingHttpClient
.
-
-