These are chat archives for ReactiveX/RxJava

4th
Feb 2016
Dorus
@Dorus
Feb 04 2016 14:35
@rgrinberg I was thinking about your problem a little more. There is an alternative to keeping references to all subscriptions. Namely passing in a cancellation token (well that's C# stuff, I'm sure Java has something similar). That way you can still cancel your work early if needed without the need to keep track of what observable finished or not.
Or store your Subscriptions in a weak reference. Anyone here able to confirm that's safe?
Rudi Grinberg
@rgrinberg
Feb 04 2016 17:18
@Dorus would a weak ref really help? The problem is that the the subscription stores a reference to the activity, not the other way.
Dorus
@Dorus
Feb 04 2016 17:45
The subscriptions are freed as soon as the activity ends.
There is no need to unsubscribe them after the activity did end, you can just drop them.
But obvious they wont be Gc'd if you keep a reference. That's why i was thinking about weak references.