static Subscriber<DeframedMessage> singleSubscriber(
            ResponseHeadersBuilder unframedHeaders, CompletableFuture<HttpResponse> res,
            @Nullable Function<AggregatedHttpResponse, AggregatedHttpResponse> responseConverter) {
        return new Subscriber<DeframedMessage>() {

            @Override
            public void onSubscribe(Subscription subscription) {
                subscription.request(1);
            }

            @Override
            public void onNext(DeframedMessage message) {
                // We know that we don't support compression, so this is always a ByteBuf.
                final ByteBuf buf = message.buf();
                assert buf != null;
                final HttpData unframedContent = HttpData.wrap(buf);
                unframedHeaders.contentType(MediaType.JSON_UTF_8);

                final AggregatedHttpResponse existingResponse = AggregatedHttpResponse.of(
                        unframedHeaders.build(),
                        unframedContent);

                if (responseConverter != null) {
                    final AggregatedHttpResponse convertedResponse = responseConverter.apply(existingResponse);
                    res.complete(convertedResponse.toHttpResponse());
                } else {
                    res.complete(existingResponse.toHttpResponse());
                }
            }

            @Override
            public void onError(Throwable t) {
                if (!res.isDone()) {
                    res.completeExceptionally(t);
                }
            }

            @Override
            public void onComplete() {
                if (!res.isDone()) {
                    // If 'ResponseObserver.onCompleted()' is called without calling 'onNext()',
                    // this callback would be invoked but 'messageRead' callback wouldn't.
                    res.complete(HttpResponse.of(unframedHeaders.build()));
                }
            }
        };
    }
Creates a new instance that decorates the specified {@link HttpService}.
grpc/src/main/java/com/linecorp/armeria/server/grpc/AbstractUnframedGrpcService.java