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

Limit Uni.join().{all,first}() concurrency #825

Merged
merged 6 commits into from
Jan 26, 2022

Conversation

jponge
Copy link
Member

@jponge jponge commented Jan 24, 2022

No description provided.

@codecov
Copy link

codecov bot commented Jan 24, 2022

Codecov Report

Merging #825 (625ac51) into main (c583ae4) will increase coverage by 0.22%.
The diff coverage is 93.75%.

❗ Current head 625ac51 differs from pull request most recent head a4a0820. Consider uploading reports for the commit a4a0820 to get more accurate results
Impacted file tree graph

@@             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     
Impacted Files Coverage Δ
...ye/mutiny/operators/uni/builders/UniJoinFirst.java 86.95% <85.71%> (+1.24%) ⬆️
...c/main/java/io/smallrye/mutiny/groups/UniJoin.java 100.00% <100.00%> (ø)
...lrye/mutiny/operators/uni/builders/UniJoinAll.java 90.66% <100.00%> (+2.53%) ⬆️
...mallrye/mutiny/operators/multi/FlatMapManager.java 95.83% <0.00%> (-2.78%) ⬇️
...mallrye/mutiny/helpers/queues/MpscLinkedQueue.java 90.32% <0.00%> (-1.62%) ⬇️
...mallrye/mutiny/operators/multi/MultiFlatMapOp.java 85.10% <0.00%> (+0.60%) ⬆️
...subscription/SwitchableSubscriptionSubscriber.java 97.60% <0.00%> (+1.59%) ⬆️
...java/io/smallrye/mutiny/helpers/Subscriptions.java 80.66% <0.00%> (+1.65%) ⬆️
...mutiny/operators/multi/MultiOperatorProcessor.java 89.09% <0.00%> (+1.81%) ⬆️
... and 7 more

Make sure we can't chain multiple withConcurrencyLimit(n) calls.
@jponge jponge marked this pull request as ready for review January 25, 2022 14:27
@jponge jponge added the enhancement New feature or request label Jan 25, 2022
@jponge jponge added this to the 1.4.0 milestone Jan 25, 2022
@jponge
Copy link
Member Author

jponge commented Jan 25, 2022

(need to add a few more tests)

@jponge jponge requested a review from cescoffier January 25, 2022 14:37
@@ -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()) {
Copy link
Contributor

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.

Copy link
Contributor

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.

@jponge jponge requested a review from cescoffier January 25, 2022 17:33
@@ -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()) {
Copy link
Contributor

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.

@jponge jponge requested a review from cescoffier January 26, 2022 08:55
@jponge jponge merged commit c33591c into main Jan 26, 2022
@jponge jponge deleted the feature/uni-join-limit-concurrency branch January 26, 2022 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants