O'Reilly logo

Reactive Programming With Java 9 by Tejaswini Mandar Jog

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

Absorb the error and then try to restart the Observable that has failed using the retryWhen() operator with delay

We have just discussed retrying using the retry() operator. The RxJava library provides the retryWhen() operator which gives flexibility to the developers to either take an action based upon the condition trigger, or ask for a resubscription.

The retryWhen() operator gets called whenever an error occurs on the source Observable. Once it gets invoked, the function provided by the operator will be invoked, accepting an Observable which contains the instance of the error which has just been emitted by the source Observable. This Observable can now emit an error, an item, or the onComplete signal. If the Observable emits an error, ...

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