contain-rs / lru-cache

A cache that holds a limited number of key-value pairs
https://contain-rs.github.io/lru-cache/lru_cache/
Apache License 2.0
82 stars 36 forks source link

Support for random-lru eviction policy #26

Open yacoder opened 8 years ago

yacoder commented 8 years ago

Tag each entry with "last-used-at" timestamp, and at eviction time pick the LRU among N randomly selected entries.

This is one of the eviction policies supported by Redis: http://redis.io/topics/lru-cache

Maybe it should be a separate container though, because it won't need the linked hash map.