Open
Description
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.