Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UniAndGroup never completes for empty list of unis. #575

Closed
lordvlad opened this issue May 28, 2021 · 1 comment · Fixed by #577
Closed

UniAndGroup never completes for empty list of unis. #575

lordvlad opened this issue May 28, 2021 · 1 comment · Fixed by #577
Milestone

Comments

@lordvlad
Copy link
Contributor

This code will never complete.

Uni.combine().all().unis(List.of()).subscribe(x -> System.out.println("yay"));

The unis method should have a guard to fire an event when the list of inputs is empty. Otherwise one always needs to guard the code beforehand like.

var combined = unis.isEmpty() ? Uni.createFrom().voidItem() : Uni.combine().all().unis(unis);
@jponge
Copy link
Member

jponge commented May 31, 2021

We should perhaps enforce the contract specified in the Javadoc:

@param unis the list of unis, must not be {@code null}, must not contain {@code null}, must not be empty

This is not enforced and should be.

@jponge jponge added this to the 0.18.0 milestone May 31, 2021
@jponge jponge linked a pull request May 31, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants