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

Getting the to-be-evicted entry from LruMap #598

Open
MarcelGarus opened this issue Aug 4, 2020 · 1 comment
Open

Getting the to-be-evicted entry from LruMap #598

MarcelGarus opened this issue Aug 4, 2020 · 1 comment

Comments

@MarcelGarus
Copy link

Currently, it feels like LruMap only targets the reading-part of caching. I'm using LruMap to provide an in-memory cache as a layer before writing to disk.
If multiple writes occur to the same object, I want the write to disk to only happen once. Currently, there's no way of getting information about which element is going to be evicted next, so when a new element is written to, it's impossible to write the oldest one to disk.
A LruMap.toBeEvictedNext getter (or something with a better name) would be great. Or a method that sets an element and also directly returns the element that will be removed from the cache because of that write.

@veljkolazic17
Copy link

ok

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

No branches or pull requests

3 participants