Package io.servicetalk.http.api
Interface BlockingHttpClient
-
- All Superinterfaces:
java.lang.AutoCloseable
,BlockingHttpRequester
,GracefulAutoCloseable
,HttpRequestFactory
public interface BlockingHttpClient extends BlockingHttpRequester
The equivalent ofHttpClient
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 BlockingStreamingHttpClient
asBlockingStreamingClient()
Convert thisBlockingHttpClient
to theBlockingStreamingHttpClient
API.default HttpClient
asClient()
Convert thisBlockingHttpClient
to theHttpClient
API.StreamingHttpClient
asStreamingClient()
Convert thisBlockingHttpClient
to theStreamingHttpClient
API.HttpResponse
request(HttpRequest request)
Send arequest
.ReservedBlockingHttpConnection
reserveConnection(HttpExecutionStrategy strategy, HttpRequestMetaData metaData)
Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.ReservedBlockingHttpConnection
reserveConnection(HttpRequestMetaData metaData)
Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.-
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.
-
reserveConnection
ReservedBlockingHttpConnection reserveConnection(HttpRequestMetaData metaData) throws java.lang.Exception
Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.- Parameters:
metaData
- Allows the underlying layers to know whatBlockingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingHttpConnection
. - Throws:
java.lang.Exception
- if a exception occurs during the reservation process.
-
reserveConnection
ReservedBlockingHttpConnection reserveConnection(HttpExecutionStrategy strategy, HttpRequestMetaData metaData) throws java.lang.Exception
Reserve aBlockingHttpConnection
based on providedHttpRequestMetaData
.- Parameters:
strategy
-HttpExecutionStrategy
to use.metaData
- Allows the underlying layers to know whatBlockingHttpConnection
s are valid to reserve for futurerequests
with the sameHttpRequestMetaData
. For example this may provide some insight into shard or other info.- Returns:
- a
ReservedBlockingHttpConnection
. - Throws:
java.lang.Exception
- if a exception occurs during the reservation process.
-
asStreamingClient
StreamingHttpClient asStreamingClient()
Convert thisBlockingHttpClient
to theStreamingHttpClient
API.- Returns:
- a
StreamingHttpClient
representation of thisBlockingHttpClient
.
-
asClient
default HttpClient asClient()
Convert thisBlockingHttpClient
to theHttpClient
API.- Returns:
- a
HttpClient
representation of thisBlockingHttpClient
.
-
asBlockingStreamingClient
default BlockingStreamingHttpClient asBlockingStreamingClient()
Convert thisBlockingHttpClient
to theBlockingStreamingHttpClient
API.- Returns:
- a
BlockingStreamingHttpClient
representation of thisBlockingHttpClient
.
-
-