https://kotlinlang.org logo
#rx
Title
# rx
i

iex

02/03/2020, 9:25 AM
Is there a point in keeping the
Disposable
of a
Single
around if you don't plan make it cancellable?
🚫 1
u

ursus

02/03/2020, 5:16 PM
youre potentially leaking the subscriber anyways
👍 1
a

alexsullivan114

02/04/2020, 1:52 PM
I think it depends on if you don't want the actual request to be cancelled or if you don't want the action taken after the request to be cancelled. If you're, say, making a network request, RxJava can't cancel the actual network request. That will finish normally. What it can do is make sure that any subscriber won't take any action after the request is finished. So if you want to make sure a network call is finished you can still hold on to the
Disposable
if you don't want an action taken after the call finishes.
i

iex

02/05/2020, 7:29 AM
@alexsullivan114 thanks for the clarification, that's very informative
a

alexsullivan114

02/05/2020, 1:27 PM
It's probably worth testing that behavior to make sure it's accurate
👍 1
2 Views