Package io.servicetalk.http.api
Interface HttpService
-
- All Superinterfaces:
AsyncCloseable
- 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 HttpService extends AsyncCloseable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Completable
closeAsync()
Closes thisHttpService
asynchronously.Single<HttpResponse>
handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory)
Handles a single HTTP request.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
-
-
-
-
Method Detail
-
handle
Single<HttpResponse> handle(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory)
Handles a single HTTP request.- Parameters:
ctx
- Context of the service.request
- to handle.responseFactory
- used to createHttpResponse
objects.- Returns:
Single
of HTTP response.
-
closeAsync
default Completable closeAsync()
Closes thisHttpService
asynchronously.- Specified by:
closeAsync
in interfaceAsyncCloseable
- Returns:
Completable
that when subscribed will close thisHttpService
.
-
-