You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Part 3 - Taming the sequence/3. Advanced error handling.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,7 +136,8 @@ public final Observable<T> retryWhen(Func1<? super Observable<? extends java.lan
136
136
137
137
The argument to `retryWhen` is a function that takes an observable and returns another. The input observable emits all the errors that `retryWhen` encounters. The resulting observable signals when to retry:
138
138
* if it emits a value, `retryWhen` will retry,
139
-
* if it terminates, `retryWhen` will emit the error and not retry.
139
+
* if it terminates with error, `retryWhen` will emit the error and not retry.
140
+
* if it terminates successfully, `retryWhen` will terminate successfully
140
141
Note that the type of the signaling obserable of the actual values emitted don't matter. The values are discarded and the observable is only used for timing.
141
142
142
143
In the next example, we will construct a retrying policy where we wait 100ms before retrying.
Our source observable emits 2 values and immediately fails. When that happens, the observable of failures inside `retryWhen` emits the error. We delay that emission by 100ms and send it back to signal to retry. `take(2)` guarantees that our signaling observabe will terminate after we receive two errors. That means that `retryWhen` won't retry after 2 failures.
172
+
Our source observable emits 2 values and immediately fails. When that happens, the observable of failures inside `retryWhen` emits the error. We delay that emission by 100ms and send it back to signal a retry. `take(2)` guarantees that our signaling observabe will terminate after we receive two errors. That means that `retryWhen` won't retry after 2 failures. We concatenate an error to make `retryWhen` also fail.
0 commit comments