Commit Graph

12 Commits (bc3d454dd6f46292f08f4f724203de22a85800ca)

Author SHA1 Message Date
Kim Alvefur a0a8ef1815 util.cache: Call on-eviction callback when shrinking 8 years ago
Kim Alvefur f06af19096 util.cache: Add a method to resize the cache 8 years ago
Kim Alvefur 53c29410bd util.cache: Add method for removing all data (does not call eviction callback) 8 years ago
Kim Alvefur 479caa7f7f util.cache: Ignore unused argument [luacheck] 9 years ago
Matthew Wild 83eb775cb0 util.cache: Add support for creating a proxy table to a cache, that looks and acts (mostly) like a normal table. No tests yet. 10 years ago
Kim Alvefur 8a13261fc2 util.cache: Add method for iterating over values 10 years ago
Matthew Wild 67ede3e093 util.cache: Change behaviour of on_evict (and tests). Now accepts false instead of a function (never evict), or on_evict can return false to prevent eviction. 10 years ago
Matthew Wild 7070585c16 util.cache: Add head() and tail() methods (and tests) 10 years ago
Matthew Wild 1b680c04ec util.cache (and tests): Call on_evict after insertion of the new key, so inside on_evict we can be more certain about the current state of the cache (i.e. full, new item added, old item removed) 10 years ago
Matthew Wild 7dc2548d04 util.cache: Small update to prefix private fields with an underscore, add a :count() method (same as util.queue) and add an optional on_evict callback 10 years ago
Kim Alvefur 1ae6748835 util.cache: Make sure cache size is specified as an integer 10 years ago
Matthew Wild 4151b38f1c util.cache: Ordered key->value data structure, with size limit (same as pubsub) 10 years ago