Package io.servicetalk.http.api
Interface BlockingHttpRequester
-
- All Superinterfaces:
java.lang.AutoCloseable
,GracefulAutoCloseable
,HttpRequestFactory
- All Known Subinterfaces:
BlockingHttpClient
,BlockingHttpConnection
,ReservedBlockingHttpConnection
public interface BlockingHttpRequester extends HttpRequestFactory, GracefulAutoCloseable
The equivalent ofHttpRequester
with synchronous/blocking APIs instead of asynchronous APIs.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
HttpExecutionContext
executionContext()
Get theHttpExecutionContext
used during construction of this object.HttpResponseFactory
httpResponseFactory()
Get aHttpResponseFactory
.HttpResponse
request(HttpExecutionStrategy strategy, HttpRequest request)
Send arequest
using the passedstrategy
.-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
request
HttpResponse request(HttpExecutionStrategy strategy, HttpRequest request) throws java.lang.Exception
Send arequest
using the passedstrategy
.- Parameters:
strategy
-HttpExecutionStrategy
to use.request
- the request to send.- Returns:
- The response.
- Throws:
java.lang.Exception
- if an exception occurs during the request processing.
-
executionContext
HttpExecutionContext executionContext()
Get theHttpExecutionContext
used during construction of this object.Note that the
ExecutionContext.ioExecutor()
will not necessarily be associated with a specific thread unless that was how this object was built.- Returns:
- the
HttpExecutionContext
used during construction of this object.
-
httpResponseFactory
HttpResponseFactory httpResponseFactory()
Get aHttpResponseFactory
.- Returns:
- a
HttpResponseFactory
.
-
close
default void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-