@Override
    public final CompletableFuture<Void> whenConsumed() {
        final AwaitDemandFuture f = new AwaitDemandFuture();
        if (!isOpen()) {
            f.completeExceptionally(ClosedStreamException.get());
            return f;
        }

        addObjectOrEvent(f);
        return f;
    }
Anything in the queue must be cleaned up.
Enters this state when there's no chance of consumption by subscriber.
i.e. when any of the following methods are invoked:
<ul>
  <li>{@link Subscription#cancel()}</li>
  <li>{@link #abort()} (via {@link AbortingSubscriber})</li>
  <li>{@link Subscriber#onComplete()}</li>
  <li>{@link Subscriber#onError(Throwable)}</li>
</ul>
core/src/main/java/com/linecorp/armeria/common/stream/AbstractStreamWriter.java