O'Reilly logo

Learning Reactive Programming with Java 8 by Nickolay Tsvetinov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Subscribing and unsubscribing

The Observable.subscribe() method has many overloads as follows:

  • subscribe(): This one ignores all the emissions from the Observable instance and throws an OnErrorNotImplementedException exception if there is an OnError notification. This can be used to only trigger the OnSubscribe.call behavior.
  • subscribe(Action1<? super T>): This only subscribes to onNext() method-triggered updates. It ignores the OnCompleted notification and throws an OnErrorNotImplementedException exception if there is an OnError 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required