retryWhen

fun <T> Single<T>.retryWhen(handler: (Observable<Throwable>) -> Observable<*>): Single<T>

Returns a Single that automatically resubscribes to this Single if it signals onError and the Observable returned by the handler function emits a value for that specific Throwable.

Please refer to the corresponding RxJava document.