public class StreamingHttpServiceToOffloadedStreamingHttpService extends Object implements StreamingHttpService
StreamingHttpService to apply the provided HttpExecutionStrategy and Executor for
offloading.| Modifier and Type | Method and Description |
|---|---|
Completable |
closeAsync()
Closes this
StreamingHttpService asynchronously. |
Completable |
closeAsyncGracefully() |
Single<StreamingHttpResponse> |
handle(HttpServiceContext ctx,
StreamingHttpRequest request,
StreamingHttpResponseFactory responseFactory)
Handles a single HTTP request.
|
static StreamingHttpService |
offloadService(HttpExecutionStrategy strategy,
Executor executor,
BooleanSupplier shouldOffload,
StreamingHttpService service)
Wraps the passed
StreamingHttpServiceToOffloadedStreamingHttpService to apply the provided
HttpExecutionStrategy for offloading. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrequiredOffloadsdefaultStreamingInfluencer, influenceStrategypublic Single<StreamingHttpResponse> handle(HttpServiceContext ctx, StreamingHttpRequest request, StreamingHttpResponseFactory responseFactory)
StreamingHttpServicehandle in interface StreamingHttpServicectx - Context of the service.request - to handle.responseFactory - used to create StreamingHttpResponse objects.Single of HTTP response.public Completable closeAsync()
StreamingHttpServiceStreamingHttpService asynchronously.closeAsync in interface AsyncCloseablecloseAsync in interface StreamingHttpServiceCompletable that when subscribed will close this StreamingHttpService.public Completable closeAsyncGracefully()
closeAsyncGracefully in interface AsyncCloseablepublic static StreamingHttpService offloadService(HttpExecutionStrategy strategy, @Nullable Executor executor, BooleanSupplier shouldOffload, StreamingHttpService service)
StreamingHttpServiceToOffloadedStreamingHttpService to apply the provided
HttpExecutionStrategy for offloading.strategy - HttpExecutionStrategy to use for offloading.executor - Executor to use as executor or null to use Execution context executor.shouldOffload - If BooleanSupplier returns true then offload to executor otherwise continue
execution on calling thread.service - StreamingHttpServiceToOffloadedStreamingHttpService to wrap.StreamingHttpServiceToOffloadedStreamingHttpService.