Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: distinguish between manual removal and natural LRU eviction #180

Open
jamesmoessis opened this issue Aug 21, 2024 · 0 comments

Comments

@jamesmoessis
Copy link

Wondering if you would accept a PR for the following:

My use case is that I don't want the eviction callback to be called when I am manually calling c.Remove(k), only when natural LRU eviction occurs. Reasoning: I have a metric of how long something stays on the LRU cache. Then if I manually Remove() from the cache, this metric is polluted because now it doesn't track the natural LRU eviction time, but just the time since insertion of the key.

Would you accept a PR to add a new method to the simple cache, for example a Delete() or RemoveWithoutEvictCB() method. I would be happy to contribute, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant