aboutsummaryrefslogtreecommitdiffstats
path: root/util/cache.lua
Commit message (Collapse)AuthorAgeFilesLines
* util.cache: Call on-eviction callback when shrinkingKim Alvefur2017-11-181-1/+6
|
* util.cache: Add a method to resize the cacheKim Alvefur2017-11-181-0/+14
|
* util.cache: Add method for removing all data (does not call eviction callback)Kim Alvefur2017-11-071-0/+7
|
* util.cache: Ignore unused argument [luacheck]Kim Alvefur2016-10-181-0/+1
|
* util.cache: Add support for creating a proxy table to a cache, that looks ↵Matthew Wild2016-05-221-0/+22
| | | | and acts (mostly) like a normal table. No tests yet.
* util.cache: Add method for iterating over valuesKim Alvefur2016-04-151-0/+12
|
* util.cache: Change behaviour of on_evict (and tests). Now accepts false ↵Matthew Wild2016-03-171-5/+5
| | | | instead of a function (never evict), or on_evict can return false to prevent eviction.
* util.cache: Add head() and tail() methods (and tests)Matthew Wild2016-03-171-0/+12
|
* util.cache (and tests): Call on_evict after insertion of the new key, so ↵Matthew Wild2015-12-221-5/+6
| | | | inside on_evict we can be more certain about the current state of the cache (i.e. full, new item added, old item removed)
* util.cache: Small update to prefix private fields with an underscore, add a ↵Matthew Wild2015-11-261-32/+43
| | | | :count() method (same as util.queue) and add an optional on_evict callback
* util.cache: Make sure cache size is specified as an integerKim Alvefur2015-11-251-0/+2
|
* util.cache: Ordered key->value data structure, with size limit (same as pubsub)Matthew Wild2015-11-241-0/+91