class DefaultHttpExecutionStrategy implements HttpExecutionStrategy {

    @Override
    public Publisher<Object> invokeService(
            final Executor fallback, StreamingHttpRequest request,
            final Function<StreamingHttpRequest, Publisher<Object>> service,
            final BiFunction<Throwable, Executor, Publisher<Object>> errorHandler) {
        final Executor e = executor(fallback);
        if (offloaded(OFFLOAD_RECEIVE_DATA)) {
            request = request.transformRawPayloadBody(payload -> payload.publishOn(e));
        }
        Publisher<Object> resp;
        if (offloaded(OFFLOAD_RECEIVE_META)) {
            final StreamingHttpRequest r = request;
            resp = e.submit(() -> service.apply(r).subscribeShareContext())
                    .recoverWith(cause -> succeeded(errorHandler.apply(cause, e)))
                    // exec.submit() returns a Single<Publisher<Object>>, so flatten the nested Publisher.
                    .flatMapPublisher(identity());
        } else {
            resp = service.apply(request);
        }
        if (offloaded(OFFLOAD_SEND)) {
            resp = resp.subscribeOn(e);
        }
        return resp;
    }

      DefaultHttpExecutionStrategy(@Nullable final Executor executor, final byte offloads, final boolean threadAffinity,
                                 final MergeStrategy mergeStrategy);
      DefaultHttpExecutionStrategy(byte offloadOverride, HttpExecutionStrategy original);

}