protected final void delegateOnCompletion(CompletionStage<? extends Publisher<T>> stage) {
        requireNonNull(stage, "stage");
        stage.handle((upstream, thrown) -> {
            if (thrown != null) {
                close(Exceptions.peel(thrown));
            } else if (upstream == null) {
                close(new NullPointerException("upstream stage produced a null stream message: " + stage));
            } else {
                delegate(StreamMessage.of(upstream));
            }
            return null;
        });
    }
Delegates when the specified {@link CompletionStage} is complete.
core/src/main/java/com/linecorp/armeria/common/stream/DeferredStreamMessage.java