Package io.servicetalk.http.api
Interface HttpService
- All Superinterfaces:
AsyncCloseable
,ExecutionStrategyInfluencer<HttpExecutionStrategy>
,HttpExecutionStrategyInfluencer
,HttpServiceBase
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Completable
Closes thisHttpService
asynchronously.handle
(HttpServiceContext ctx, HttpRequest request, HttpResponseFactory responseFactory) Handles a single HTTP request.default HttpExecutionStrategy
Return anExecutionStrategy
that describes the offloads required by the influencer.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefully
Methods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy
-
Method Details
-
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.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencer
Return anExecutionStrategy
that describes the offloads required by the influencer.The provided default implementation requests offloading of all operations. Implementations that require no offloading should be careful to return
HttpExecutionStrategies.offloadNone()
rather thanHttpExecutionStrategies.offloadNever()
. Implementations should avoid returningHttpExecutionStrategies.defaultStrategy()
, instead returning the strategy they require orHttpExecutionStrategies.offloadAll()
if offloading for all paths is required (safe default).- Specified by:
requiredOffloads
in interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>
- Specified by:
requiredOffloads
in interfaceHttpExecutionStrategyInfluencer
- Returns:
- the
ExecutionStrategy
required by the influencer.
-
closeAsync
Closes thisHttpService
asynchronously.- Specified by:
closeAsync
in interfaceAsyncCloseable
- Returns:
Completable
that when subscribed will close thisHttpService
.
-