class BufferedEmittingPublisher implements Flow.Publisher<T> {

    @Override
    public void subscribe(final Flow.Subscriber<? super T> subscriber) {
        emitter.onSubscribe(() -> state.get().drain(this));
        emitter.onRequest((n, cnt) -> {
            if (requestCallback != null) {
                requestCallback.accept(n, cnt);
            }
            state.get().drain(this);
        });
        emitter.onCancel(() -> state.compareAndSet(State.READY_TO_EMIT, State.CANCELLED));
        emitter.subscribe(subscriber);
    }

    protected  BufferedEmittingPublisher();

}