LibRingCache

LibRingCache is an implementation of a cache that selectively lets the garbage collector collect old items but keeps the newest.

See documentation for usage information.

Why would you want to use this?

Currently you might just have a simple cache table with a _mode = "kv" metatable, but that isn't the best way because when the garbage collector runs, it will collect all entries no matter how old (or recent) they are. This cache implementation will ensure that you will keep your N most recent items in the cache.

Generally spoken, LibRingCache is useful to you if you want to keep X recent items, but still have to access them by an associative value (as opposed to just an incrementing number)

Because a cache that is always empty is useless.

You must login to post a comment. Don't have an account? Register to get one!

Facts

Date created
14 May 2009
Category
Last update
26 Oct 2009
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
LibRingCache
Reverse relationships
1
Recent files
  • R: 1.5 for 3.2.0 on 26 Oct 2009
  • A: r12 for 3.2.0 on 08 Aug 2009
  • R: 1.1 for 3.1.0 on 08 Jul 2009
  • A: r10 for 3.1.0 on 07 Jul 2009
  • A: r9 for 3.1.0 on 07 Jul 2009

Authors