smallrye-mutiny: MultiCollector does not collect an empty Multi

This code in MultiBufferOp.BufferExactProcessor means that empty Multi will never collect into an empty List, even though I believe this is wrong:

        public void onCompletion() {
            Subscription subscription = upstream.getAndSet(CANCELLED);
            if (subscription != CANCELLED) {
                List<T> buffer = current;
                if (buffer != null && !buffer.isEmpty()) {
                    downstream.onItem(buffer);
                }
                downstream.onCompletion();
            }
        }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (20 by maintainers)

Commits related to this issue

Most upvoted comments

Not implemented yet, but replaceIfNullWith still sounds like a good fit.