-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
I would like to limit the expiry process of cached values, based not only on time, but also on properties of the object. I can see two ways to achieve this, both of which would require API changes:
- Modify the expiry process to evaluate a predicate against the cached value and skip expiry of a value if the predicate applies;
- Use a removal listener to apply the predicate, then add the entry back in it it applies.
The latter approach leaves a window of time where a new value could be created, then replaced by the put() (a putIfAbsent() would appear to solve this).
Is there a way to achieve the above use case using the current API?
Metadata
Metadata
Assignees
Labels
No labels