@FunctionalInterface public interface BlockingStreamingHttpService extends HttpServiceBase, GracefulAutoCloseable
StreamingHttpService but with synchronous/blocking APIs instead of asynchronous APIs.| Modifier and Type | Method and Description |
|---|---|
default void |
close() |
void |
handle(HttpServiceContext ctx,
BlockingStreamingHttpRequest request,
BlockingStreamingHttpServerResponse response)
Handles a single HTTP request.
|
default HttpExecutionStrategy |
requiredOffloads() |
defaultStreamingInfluencer, influenceStrategyvoid handle(HttpServiceContext ctx, BlockingStreamingHttpRequest request, BlockingStreamingHttpServerResponse response) throws Exception
ctx - Context of the service.request - to handle.response - to send to the client. The implementation of this method is responsible for closing
HttpPayloadWriter or HttpOutputStream after meta-data is sent and payload body is written.Exception - If an exception occurs during request processing.default HttpExecutionStrategy requiredOffloads()
HttpExecutionStrategyInfluencerThe provided default implementation requests offloading of all operations. Implementations that require no
offloading should be careful to return HttpExecutionStrategies.offloadNone() rather than
HttpExecutionStrategies.offloadNever(). Implementations should avoid returning
HttpExecutionStrategies.defaultStrategy(), instead returning the strategy they require or
HttpExecutionStrategies.offloadAll() if offloading for all paths is required (safe default).
requiredOffloads in interface ExecutionStrategyInfluencer<HttpExecutionStrategy>requiredOffloads in interface HttpExecutionStrategyInfluencerdefault void close()
throws Exception
close in interface AutoCloseableException