We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d11791 commit e285a7bCopy full SHA for e285a7b
1 file changed
rxjava-core/src/main/java/rx/operators/OnSubscribeToObservableFuture.java
@@ -62,6 +62,10 @@ public void call() {
62
}
63
}));
64
try {
65
+ //don't block or propagate CancellationException if already unsubscribed
66
+ if (subscriber.isUnsubscribed()) {
67
+ return;
68
+ }
69
T value = (unit == null) ? (T) that.get() : (T) that.get(time, unit);
70
subscriber.onNext(value);
71
subscriber.onCompleted();
@@ -71,6 +75,10 @@ public void call() {
75
// since it's already subscribed.
72
76
// If the Future is canceled in other place, CancellationException will be still
73
77
// passed to the final Subscriber.
78
79
+ //refuse to emit onError if already unsubscribed
80
81
74
82
subscriber.onError(e);
83
84
0 commit comments