I`m struggling to retry my rxjava Single call after another network call is done in doOnError:
restApi.getStuff()
       .subscribeOn(Schedulers.io())
       .observeOn(AndroidSchedulers.mainThread())
       .doOnError {
            getRefreshToken(it, AuthenticationManager.Callback{
                retry(1)
            })
       }
       .subscribeBy(
             onSuccess = { response ->},
             onError = { throwable ->}
       )
But the retry method cannot be invoked inside the doOnError method. Do you have any other ideas?
 
    