mastercache
Version:
Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers
16 lines (13 loc) • 418 B
TypeScript
import { MutexInterface } from 'async-mutex';
declare class Locks {
#private;
/**
* For a given key, get or create a new lock
*
* @param key Key to get or create a lock for
* @param timeout Time to wait to acquire the lock
*/
getOrCreateForKey(key: string, timeout?: number): MutexInterface;
release(key: string, releaser: MutexInterface.Releaser): void;
}
export { Locks };