promotional bannermobile promotional banner

LibRingCache

Library for a fast cache implementation that discards items by age in units

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.

The LibRingCache Team

profile avatar
  • 12
    Projects
  • 650.3K
    Downloads

More from watchout_cfView all

  • Analogue Clock project image

    Analogue Clock

    • 14.4K
    • Addons

    Analogue clock for the minimap

    • 14.4K
    • May 21, 2023
    • Addons
    • +1
  • Grease Goblin project image

    Grease Goblin

    • 3.7K
    • Addons

    In-game automated scripting suite by watchout@curse.com

    • 3.7K
    • September 8, 2016
    • Addons
  • watch project image

    watch

    • 4.0K
    • Addons

    Continuously evaluates and displays the contents of a variable or the result of an expression

    • 4.0K
    • August 25, 2016
    • Addons
  • LuaTokenizer project image

    LuaTokenizer

    • 542
    • Addons

    A tokenizer for the Lua language

    • 542
    • July 23, 2016
    • Addons
  • Analogue Clock project image

    Analogue Clock

    • 14.4K
    • Addons

    Analogue clock for the minimap

    • 14.4K
    • May 21, 2023
    • Addons
    • +1
  • Grease Goblin project image

    Grease Goblin

    • 3.7K
    • Addons

    In-game automated scripting suite by watchout@curse.com

    • 3.7K
    • September 8, 2016
    • Addons
  • watch project image

    watch

    • 4.0K
    • Addons

    Continuously evaluates and displays the contents of a variable or the result of an expression

    • 4.0K
    • August 25, 2016
    • Addons
  • LuaTokenizer project image

    LuaTokenizer

    • 542
    • Addons

    A tokenizer for the Lua language

    • 542
    • July 23, 2016
    • Addons