A disposable (previously called Subscription in RxJava 1.0) is a tool that can be used to control the life cycle of an Observable. If the stream of data that the Observable is producing is boundless, it means that it will stay active forever. It might not be a problem for a server-side application, but it can cause some serious trouble on Android. Usually, this is the common source of memory leaks. This will be discussed in-depth in the upcoming chapters.
Obtaining a reference to a disposable is pretty simple:
Disposable disposable = Observable.just("First item", "Second item") .subscribe();
A disposable is a very simple interface. It has only two methods: dispose() and isDisposed() .
The dispose() element can be used to cancel ...