Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,14 @@ public MultiRetryWhenOp(Multi<? extends T> upstream, Predicate<? super Throwable
private static <T> void subscribe(MultiSubscriber<? super T> downstream, Predicate<? super Throwable> onFailurePredicate,
Function<? super Multi<Throwable>, ? extends Publisher<?>> triggerStreamFactory,
Multi<? extends T> upstream) {
TriggerSubscriber other = new TriggerSubscriber();
Context context;
if (downstream instanceof ContextSupport provider) {
context = provider.context();
} else {
context = Context.empty();
}

TriggerSubscriber other = new TriggerSubscriber(context);
Subscriber<Throwable> signaller = new SerializedSubscriber<>(other.processor);
signaller.onSubscribe(Subscriptions.empty());
MultiSubscriber<T> serialized = new SerializedSubscriber<>(downstream);
Expand Down Expand Up @@ -176,7 +183,11 @@ static final class TriggerSubscriber extends AbstractMulti<Throwable>
implements Multi<Throwable>, Subscriber<Object>, ContextSupport {
RetryWhenOperator<?> operator;
private final Flow.Processor<Throwable, Throwable> processor = UnicastProcessor.<Throwable> create().serialized();
private Context context;
private final Context context;

TriggerSubscriber(Context context) {
this.context = context;
}

@Override
public void onSubscribe(Flow.Subscription s) {
Expand All @@ -200,11 +211,6 @@ public void onComplete() {

@Override
public void subscribe(Subscriber<? super Throwable> actual) {
if (actual instanceof ContextSupport) {
this.context = ((ContextSupport) actual).context();
} else {
this.context = Context.empty();
}
processor.subscribe(actual);
}

Expand Down
Loading