Skip to content

Commit

Permalink
Merge #3221 into 3.5.0-RC1
Browse files Browse the repository at this point in the history
Since the codebase for MonoCompletionStage has diverged, there were
some conflicts. `main`-oriented variant of the PR was provided in #3222
which was used to resolve these conflicts.

Supersedes and closes #3222.
  • Loading branch information
simonbasle committed Oct 10, 2022
2 parents 303d185 + f160733 commit cd8be49
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;

import reactor.core.CoreSubscriber;
import reactor.core.Exceptions;
Expand Down Expand Up @@ -62,7 +62,7 @@ public Object scanUnsafe(Attr key) {
static class MonoCompletionStageSubscription<T> implements InnerProducer<T>,
Fuseable,
QueueSubscription<T>,
BiConsumer<T, Throwable> {
BiFunction<T, Throwable, Void> {

final CoreSubscriber<? super T> actual;
final CompletionStage<? extends T> future;
Expand All @@ -85,7 +85,7 @@ public CoreSubscriber<? super T> actual() {
}

@Override
public void accept(@Nullable T value, @Nullable Throwable e) {
public Void apply(@Nullable T value, @Nullable Throwable e) {
final CoreSubscriber<? super T> actual = this.actual;

if (this.cancelled) {
Expand All @@ -102,7 +102,7 @@ public void accept(@Nullable T value, @Nullable Throwable e) {
Operators.onDiscard(value, ctx);
}

return;
return null;
}

try {
Expand All @@ -124,6 +124,7 @@ else if (value != null) {
Operators.onErrorDropped(e1, actual.currentContext());
throw Exceptions.bubble(e1);
}
return null;
}

@Override
Expand All @@ -136,7 +137,7 @@ public void request(long n) {
return;
}

future.whenComplete(this);
future.handle(this);
}

@Override
Expand Down

1 comment on commit cd8be49

@He-Pin
Copy link
Contributor

@He-Pin He-Pin commented on cd8be49 Oct 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool~~

Please sign in to comment.