-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Description
If I understand correctly, a Subscriber should send unsubscriptions only upwards but never downwards. So whenever lift is used one would need to chain up Subscribers like this:
Subscriber<U> call(Subscriber<T> o) {
Subscriber<U> u = ...
o.add(u);
return u;
}
Here, o comes from the client. Calling o.unsubscribe will propagate to u.unsubscribe and up on the chain. However, if u.unsubscribe is called, It won't affect o's subscriptions, i.e., u should send out onCompleted event to affect downstream.
However, the OperatorMap doesn't do this but basically shares the same CompositeSubscription between o and u, therefore, unsubscription will affect both upstream and downstream. OperatorTake completely ignores unsubscription coming from o as well, letting the following example spin trough the 1G values in the background.
Observable.range(0, 1_000_000_000).take(1_000_000_000).take(1).toBlockingObservable().last();
Thread.sleep(5000);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels