Код: Выделить всё
Retryer.retry(
() -> {
doSomething();
return null;
},
e -> shouldRetry(e), //boolean predicate with exception input
getRetryCount() //int retry count
).call();
Я мог бы думать о следующем способе, где переменный int int int ud word retrery : p> p> p> p> p> p> p>: Я мог бы думать о следующем способе, в котором переменный
Код: Выделить всё
int retryCount = 0;
boolean shouldRetry(Exception e){
if(e instance of...){
retryCount = 5;
return true;
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... a-variable