-
Notifications
You must be signed in to change notification settings - Fork 128
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
Limit Uni.join().{all,first}() concurrency #825
Conversation
Codecov Report
@@ Coverage Diff @@
## main #825 +/- ##
============================================
+ Coverage 88.83% 89.05% +0.22%
- Complexity 3044 3051 +7
============================================
Files 383 383
Lines 12133 12175 +42
Branches 1526 1543 +17
============================================
+ Hits 10778 10843 +65
+ Misses 722 707 -15
+ Partials 633 625 -8
|
Make sure we can't chain multiple withConcurrencyLimit(n) calls.
(need to add a few more tests) |
implementation/src/main/java/io/smallrye/mutiny/operators/uni/builders/UniJoinAll.java
Show resolved
Hide resolved
implementation/src/main/java/io/smallrye/mutiny/operators/uni/builders/UniJoinAll.java
Show resolved
Hide resolved
@@ -96,6 +119,11 @@ private void onFailure(Throwable failure) { | |||
if (failures.size() == unis.size()) { | |||
cancelled.set(true); | |||
subscriber.onFailure(new CompositeException(failures)); | |||
} else if (concurrency != -1) { | |||
int nextIndex = nextSubscriptionIndex.incrementAndGet(); | |||
if (nextIndex < unis.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here - we need to check for cancellation before doing the subscription.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jponge it needs to check for cancellation too.
@@ -96,6 +119,11 @@ private void onFailure(Throwable failure) { | |||
if (failures.size() == unis.size()) { | |||
cancelled.set(true); | |||
subscriber.onFailure(new CompositeException(failures)); | |||
} else if (concurrency != -1) { | |||
int nextIndex = nextSubscriptionIndex.incrementAndGet(); | |||
if (nextIndex < unis.size()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jponge it needs to check for cancellation too.
No description provided.