Class | Iowa::LRUCache |
In: |
src/LRUCache.rb
|
Parent: | Object |
Simple LRU cache for caching pages.
Initialize the empty LRU cache, and set the maximum number of elements that it will contain or the max time to live (in seconds) of a cache item. If both a max and a maxttl are set, the max is a hard maximum that will not be exceeded.
Adds a finalization method to the cache that will be called before the object in the cache is expired.
Is called when an object in the cache is expired. Iterates through the defined finalization methods, if any.
Allows one to set the maximum size of the cache queue. If the queue is currently larger than the size that it is being set to, elements will be expired until the queue is at the maximum size.