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
- Fix #175 - When grouping items into lists from an empty stream, it should produce a stream containing a single empty list item. — committed to smallrye/smallrye-mutiny by cescoffier 4 years ago
- Implement Uni.replaceIfNullWith(value / supplier) shortcuts Closes #175 — committed to smallrye/smallrye-mutiny by jponge 3 years ago
Not implemented yet, but
replaceIfNullWithstill sounds like a good fit.