当请求令牌应在其他调用中刷新时,我想链接两个用例请求:
逻辑应该是这样的:
当前开始/方法:
<T> SingleTransformer<T, T> get() {
return single -> single.retry((retryCount, throwable) -> {
boolean isRetryNecessary = false;
if (retryCount <= MAX_RETRIES) {
ExceptionCause cause = getCause(throwable);
if (cause == ExceptionCause.SSL) {
handleIt();
isRetryNecessary = true;
}
if (cause != ExceptionCause.OTHER) {
loginUser();
isRetryNecessary = true;
}
}
return isRetryNecessary;
});
loginUser:
Single loginUser() {
return Single.fromFuture(ApiCallRegister())
.subscribeOn(Schedulers.io())
.unsubscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
}
如何链接这两个提到的逻辑请求?