zkt-updater
fast and reliable inventory cache based on redis
Install
npm install zkt-updater
Usage
const updater = 'ticketInventory' async { let t = await db; return ttotal * 1; } async { //diff < 0 await db; }; //... router;
Options
get(id, ...args)
get value function, returns Promise
change(id, diff, ...args)
update value function, returns Promise
changeDelay
(default 1 second), when value changed in redis, wait some time before call the change
function
redisOptions
default: process.env.REDIS_URL