lua-resty-mlcache icon indicating copy to clipboard operation
lua-resty-mlcache copied to clipboard

Add an option to run without LRU cache

Open thibaultcha opened this issue 7 years ago • 3 comments

This can help environment where a smaller memory footprint is required, by taking advantage of the shared memory nature of the L2 (shm) cache.

thibaultcha avatar Feb 16 '18 06:02 thibaultcha

this is a great feature, i could not find the implementation from master,isn't done? where can i find it? or does it need myself to finish?

FengXingYuXin avatar Dec 17 '18 08:12 FengXingYuXin

@FengXingYuXin This feature is not implemented yet. Contributions welcome!

thibaultcha avatar Dec 18 '18 15:12 thibaultcha

For now it can be achieved by:

local noop = function() end
local noop_lru = {set = noop, get = noop, delete = noop, flush_all = noop}
local noop_ipc = {subscribe = noop, broadcast = noop, poll = noop, register_listeners = noop}

mlcache.new("name", "shm", {
    lru = noop_lru,
    ipc = noop_ipc
})

It will break after purge() is called, but for some use cases it may be enough.

piotrp avatar Mar 24 '19 17:03 piotrp