Package io.servicetalk.http.api
Interface StreamingHttpService
- All Superinterfaces:
AsyncCloseable,ExecutionStrategyInfluencer<HttpExecutionStrategy>,HttpExecutionStrategyInfluencer,HttpServiceBase
- All Known Implementing Classes:
StreamingHttpServiceFilter,StreamingHttpServiceToOffloadedStreamingHttpService
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A service contract for the HTTP protocol.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CompletableCloses thisStreamingHttpServiceasynchronously.handle(HttpServiceContext ctx, StreamingHttpRequest request, StreamingHttpResponseFactory responseFactory) Handles a single HTTP request.default HttpExecutionStrategyReturn anExecutionStrategythat describes the offloads required by the influencer.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsyncGracefullyMethods inherited from interface io.servicetalk.http.api.HttpExecutionStrategyInfluencer
influenceStrategy
-
Method Details
-
handle
Single<StreamingHttpResponse> handle(HttpServiceContext ctx, StreamingHttpRequest request, StreamingHttpResponseFactory responseFactory) Handles a single HTTP request.- Parameters:
ctx- Context of the service.request- to handle.responseFactory- used to createStreamingHttpResponseobjects.- Returns:
Singleof HTTP response.
-
closeAsync
Closes thisStreamingHttpServiceasynchronously.- Specified by:
closeAsyncin interfaceAsyncCloseable- Returns:
Completablethat when subscribed will close thisStreamingHttpService.
-
requiredOffloads
Description copied from interface:HttpExecutionStrategyInfluencerReturn anExecutionStrategythat 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:
requiredOffloadsin interfaceExecutionStrategyInfluencer<HttpExecutionStrategy>- Specified by:
requiredOffloadsin interfaceHttpExecutionStrategyInfluencer- Returns:
- the
ExecutionStrategyrequired by the influencer.
-