I ask this from an Android perspective, but this should apply to RxJava in general.
As a best practice, should my view always delete even short-lived Completable , Single , Maybe and ending with Observable Rx types, which should end in short order, but can still be executed when the user closes the view? I know that when the Rx chain ends, it is deleted, but this may happen sometime after closing the view.
For example, Single executing an HTTP GET. The call ends, but may be after the destruction of a species that temporarily prevents garbage collection.
And if a CompositeDisposable used to collect such a Disposable in a long-lasting view, would I think it should take care of clear() or otherwise remove these Disposable regularly to prevent an unlimited growth in size of the CompositeDisposable ?
android rx-java dispose rx-java2
Holy samosa
source share