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
Sometimes, it is necessary to retry on a non-exceptional result (such as null or Optional.empty()). This should be fairly simple to implement, API design is the most problematic concern.
Programmatic API: this one is fairly simple, add a method whenResult(Predicate<T>) to the RetryBuilder. Possibly also rename when() to whenException() to better highlight what's going on. It is not obvious what to do if whenResult() is called and when[Exception]() isn't (and possibly retryOn() / abortOn() is).
Declarative API: we cannot do anything else but add a 2nd annotation. @RetryOnResult seems like a good name. It is not obvious how to define the predicate. Probably start small and add a single member Class<Predicate<Object>> value().
The text was updated successfully, but these errors were encountered:
Sometimes, it is necessary to retry on a non-exceptional result (such as
null
orOptional.empty()
). This should be fairly simple to implement, API design is the most problematic concern.Programmatic API: this one is fairly simple, add a method
whenResult(Predicate<T>)
to theRetryBuilder
. Possibly also renamewhen()
towhenException()
to better highlight what's going on. It is not obvious what to do ifwhenResult()
is called andwhen[Exception]()
isn't (and possiblyretryOn()
/abortOn()
is).Declarative API: we cannot do anything else but add a 2nd annotation.
@RetryOnResult
seems like a good name. It is not obvious how to define the predicate. Probably start small and add a single memberClass<Predicate<Object>> value()
.The text was updated successfully, but these errors were encountered: