Package io.servicetalk.http.api
Interface BlockingHttpService
-
- All Superinterfaces:
java.lang.AutoCloseable
,GracefulAutoCloseable
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface BlockingHttpService extends GracefulAutoCloseable
The equivalent ofHttpService
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 void
close()
HttpResponse
handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory)
Handles a single HTTP request.-
Methods inherited from interface io.servicetalk.concurrent.GracefulAutoCloseable
closeGracefully
-
-
-
-
Method Detail
-
handle
HttpResponse handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory) throws java.lang.Exception
Handles a single HTTP request.- Parameters:
ctx
- Context of the service.request
- to handle.responseFactory
- used to createHttpResponse
objects.- Returns:
Single
of HTTP response.- Throws:
java.lang.Exception
- If an exception occurs during request processing.
-
close
default void close() throws java.lang.Exception
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.lang.Exception
-
-