private CompletionStage<HttpResponse> serve1(ServiceRequestContext ctx, HttpRequest req,
                                                 AggregationType aggregationType) {
        final CompletableFuture<AggregatedResult> f;
        switch (aggregationType) {
            case MULTIPART:
                f = FileAggregatedMultipart.aggregateMultipart(ctx, req).thenApply(AggregatedResult::new);
                break;
            case ALL:
                f = req.aggregate().thenApply(AggregatedResult::new);
                break;
            case NONE:
                f = NO_AGGREGATION_FUTURE;
                break;
            default:
                // Should never reach here.
                throw new Error();
        }

        switch (responseType) {
            case HTTP_RESPONSE:
                if (useBlockingTaskExecutor) {
                    return f.thenApplyAsync(aReq -> (HttpResponse) invoke(ctx, req, aReq),
                                            ctx.blockingTaskExecutor());
                } else {
                    return f.thenApply(aReq -> (HttpResponse) invoke(ctx, req, aReq));
                }
            case COMPLETION_STAGE:
            case KOTLIN_COROUTINES:
            case SCALA_FUTURE:
                final CompletableFuture<?> composedFuture;
                if (useBlockingTaskExecutor) {
                    composedFuture = f.thenComposeAsync(
                            aReq -> toCompletionStage(invoke(ctx, req, aReq), ctx.blockingTaskExecutor()),
                            ctx.blockingTaskExecutor());
                } else {
                    composedFuture = f.thenCompose(
                            aReq -> toCompletionStage(invoke(ctx, req, aReq), ctx.eventLoop()));
                }
                return composedFuture.thenApply(result -> convertResponse(ctx, result));
            default:
                final Function<AggregatedResult, HttpResponse> defaultApplyFunction =
                        aReq -> convertResponse(ctx, invoke(ctx, req, aReq));
                if (useBlockingTaskExecutor) {
                    return f.thenApplyAsync(defaultApplyFunction, ctx.blockingTaskExecutor());
                } else {
                    return f.thenApply(defaultApplyFunction);
                }
        }
    }
Executes the service method in different ways regarding its return type and whether the request is
required to be aggregated. If the return type of the method is not a {@link CompletionStage} or
{@link HttpResponse}, it will be executed in the blocking task executor.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/DefaultAnnotatedService.java