static HttpResponse of(Publisher<? extends HttpObject> publisher) {
        requireNonNull(publisher, "publisher");
        if (publisher instanceof HttpResponse) {
            return (HttpResponse) publisher;
        } else if (publisher instanceof StreamMessage) {
            return new StreamMessageBasedHttpResponse((StreamMessage<? extends HttpObject>) publisher);
        } else {
            return new PublisherBasedHttpResponse(publisher);
        }
    }
Creates a new HTTP response whose stream is produced from an existing {@link Publisher}.

<p>Note that the {@link HttpObject}s in the {@link Publisher} are not released when
{@link Subscription#cancel()} or {@link #abort()} is called. You should add a hook in order to
release the elements. See {@link PublisherBasedStreamMessage} for more information.
core/src/main/java/com/linecorp/armeria/common/HttpResponse.java