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

fix: rewrite of the concatenation operators #1448

Merged
merged 1 commit into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion implementation/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@
"criticality" : "highlight",
"minSeverity" : "POTENTIALLY_BREAKING",
"minCriticality" : "documented",
"differences" : [ ]
"differences" : [
{
"ignore": true,
"code": "java.class.removed",
"old": "class io.smallrye.mutiny.operators.multi.MultiConcatMapOp.ConcatMapMainSubscriber<I, O>",
"justification": "Internal API refactoring"
}
]
}
}, {
"extension" : "revapi.reporter.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.concurrent.Flow.Subscription;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
import java.util.concurrent.atomic.AtomicReference;

import io.smallrye.mutiny.CompositeException;
Expand Down Expand Up @@ -103,6 +104,19 @@
}
}

public static <T> long add(AtomicLongFieldUpdater<T> updater, T receiver, long requests) {
for (;;) {
long r = updater.get(receiver);
if (r == Long.MAX_VALUE) {
return Long.MAX_VALUE;

Check warning on line 111 in implementation/src/main/java/io/smallrye/mutiny/helpers/Subscriptions.java

View check run for this annotation

Codecov / codecov/patch

implementation/src/main/java/io/smallrye/mutiny/helpers/Subscriptions.java#L111

Added line #L111 was not covered by tests
}
long u = add(r, requests);
if (updater.compareAndSet(receiver, r, u)) {
return r;
}
}

Check warning on line 117 in implementation/src/main/java/io/smallrye/mutiny/helpers/Subscriptions.java

View check run for this annotation

Codecov / codecov/patch

implementation/src/main/java/io/smallrye/mutiny/helpers/Subscriptions.java#L117

Added line #L117 was not covered by tests
}

/**
* Atomically subtract the given number (positive, not validated) from the target field unless it contains Long.MAX_VALUE.
*
Expand Down
Loading
Loading