Skip to content

Support for limiting expiry of cached objects #75

@blschatz

Description

@blschatz

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:

  1. Modify the expiry process to evaluate a predicate against the cached value and skip expiry of a value if the predicate applies;
  2. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions