Subscribing and unsubscribing
The Observable.subscribe()
method has many overloads as follows:
subscribe()
: This one ignores all the emissions from theObservable
instance and throws anOnErrorNotImplementedException
exception if there is anOnError
notification. This can be used to only trigger theOnSubscribe.call
behavior.subscribe(Action1<? super T>)
: This only subscribes toonNext()
method-triggered updates. It ignores theOnCompleted
notification and throws anOnErrorNotImplementedException
exception if there is anOnError
notification. It is not a good choice for real production code, because it is hard to guarantee that no errors will be thrown.subscribe(Action1<? super T>, Action1<Throwable>)
: This is the same as preceding one, but the ...
Get Learning Reactive Programming with Java 8 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.