Class | LRUCache |
In: |
lib/facets/more/lrucache.rb
|
Parent: | Hash |
A cache utilizing a simple LRU (Least Recently Used) policy. The items managed by this cache must respond to the key method. Attempts to optimize reads rather than inserts!
LRU semantics are enforced by inserting the items in a queue. The lru item is always at the tail. Two special sentinels (head, tail) are used to simplify (?) the code.