private boolean notifySubscriberWithElements(SubscriptionImpl subscription) {
        final Subscriber<Object> subscriber = subscription.subscriber();
        if (demand == 0) {
            return false;
        }

        if (demand != Long.MAX_VALUE) {
            demand--;
        }

        @SuppressWarnings("unchecked")
        T o = (T) queue.remove();
        inOnNext = true;
        try {
            o = prepareObjectForNotification(o, subscription.withPooledObjects());
            subscriber.onNext(o);
        } catch (Throwable t) {
            if (setState(State.OPEN, State.CLEANUP) || setState(State.CLOSED, State.CLEANUP)) {
                notifySubscriberOfCloseEvent(subscription, newCloseEvent(t));
                throwIfFatal(t);
            } else {
                throwIfFatal(t);
                logger.warn("Subscriber.onNext({}) should not raise an exception. subscriber: {}",
                            o, subscriber, t);
            }

            return false;
        } finally {
            inOnNext = false;
        }
        return true;
    }
Invoked whenever a new demand is requested.
@param n Newly requested demand
core/src/main/java/com/linecorp/armeria/common/stream/DefaultStreamMessage.java