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
May 14, 2009
Category
Last update
Oct 28, 2010
Development stage
Release
License
GNU General Public License version 3 (GPLv3)
Curse link
LibRingCache
Reverse relationships
1
Downloads
863
Recent files
  • A: r15 for 4.0.1 Oct 28, 2010
  • A: r14 for 3.2.0 Jul 11, 2010
  • R: 1.5 for 3.2.0 Oct 26, 2009
  • A: r12 for 3.2.0 Aug 08, 2009
  • R: 1.1 for 3.1.0 Jul 08, 2009

Authors