Propagate the cancel signal to the downstream
This commit is contained in:
committed by
Rossen Stoyanchev
parent
03fb343528
commit
0742160821
@@ -337,6 +337,8 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||
|
||||
private final WriteBarrier writeBarrier;
|
||||
|
||||
private Subscription subscription;
|
||||
|
||||
|
||||
public WriteCompletionBarrier(CoreSubscriber<? super Void> subscriber, WriteBarrier writeBarrier) {
|
||||
this.completionSubscriber = subscriber;
|
||||
@@ -356,6 +358,7 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||
|
||||
@Override
|
||||
public void onSubscribe(Subscription subscription) {
|
||||
this.subscription = subscription;
|
||||
subscription.request(Long.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -387,6 +390,10 @@ public class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
|
||||
@Override
|
||||
public void cancel() {
|
||||
this.writeBarrier.cancel();
|
||||
Subscription subscription = this.subscription;
|
||||
if (subscription != null) {
|
||||
subscription.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user