-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
Following discussion at #909.
Right now, memoize can be configured to expire based on a BooleanSupplier. To invalidate memoized item based on its value, a solution is to used a shared AtomicBoolean with a throw/retry mechanism when the boolean become true. See #909 (reply in thread).
Another drawback is that failure cannot be skipped or memoized differently
Description
It would more convenient to be able to pass a BiFunction that takes the item and the failure and return a boolean to until().
Uni.createFrom().item(new AccessTokenResponse())
.memoize().until((item, failure) -> failure != null || item.isExpired())
Additional details
Some shortcuts could help like
Uni.createFrom().item(new AccessTokenResponse())
.memoize().notFailure().until(item -> item.isExpired())
.memoize().notFailure().atLeast(item -> item.getExpiresIn())
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request