@Override
    public HttpResponse convertResponse(ServiceRequestContext ctx,
                                        ResponseHeaders headers,
                                        @Nullable Object result,
                                        HttpHeaders trailers) throws Exception {
        if (result instanceof Observable) {
            return responseConverter.convertResponse(
                    ctx, headers, ((Observable<?>) result).toFlowable(BackpressureStrategy.BUFFER), trailers);
        }

        if (result instanceof Maybe) {
            @SuppressWarnings("unchecked")
            final CompletionStage<Object> future = ((Maybe<Object>) result).toCompletionStage(null);
            return HttpResponse.of(future.handle(handleResult(ctx, headers, trailers)));
        }

        if (result instanceof Single) {
            @SuppressWarnings("unchecked")
            final CompletionStage<Object> future = ((Single<Object>) result).toCompletionStage();
            return HttpResponse.of(future.handle(handleResult(ctx, headers, trailers)));
        }

        if (result instanceof Completable) {
            final CompletionStage<Object> future = ((Completable) result).toCompletionStage(null);
            return HttpResponse.of(future.handle(handleResult(ctx, headers, trailers)));
        }

        return ResponseConverterFunction.fallthrough();
    }
Creates a new {@link ResponseConverterFunction} instance.

@param responseConverter the function which converts an object with the configured
                         {@link ResponseConverterFunction}
rxjava3/src/main/java/com/linecorp/armeria/server/rxjava3/ObservableResponseConverterFunction.java