-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
While trying to use the retryWhen
operator of the Completable I had problems understanding the behaviour detailed in it´s javadoc:
Returns a Completable which given a Publisher and when this Completable emits an error, delivers that error through an Observable and the Publisher should return a value indicating a retry in response or a terminal event indicating a termination.
Which highly differs from the documentation of Observable, Single and the docs, where the need of calling the provided observable's onNext/onError/onCompleted is more detailed:
Returns an Observable that emits the same values as the source observable with the exception of an {@code onError}. An {@code onError} notification from the source will result in the emission of a {@link Throwable} item to the Observable provided as an argument to the {@code notificationHandler} function. If that Observable calls {@code onComplete} or {@code onError} then {@code retry} will call {@code onCompleted} or {@code onError} on the child subscription. Otherwise, this Observable will resubscribe to the source Observable.
I could prepare a PR for both 1.x and 2.x versions if needed.