@linkedmink/multilevel-aging-cache
Version:
Package provides an interface to cache and persist data to Redis, MongoDB, memory
21 lines • 1.27 kB
TypeScript
import { IAgedValue, IAgedQueue } from '../queue/IAgedQueue';
import { IAgingCacheWrite } from './IAgingCache';
import { IStorageHierarchy, IStorageHierarchyWrite } from '../storage/IStorageHierarchy';
/**
* Keep common methods and data for each set/delete strategy here
*/
export declare abstract class AgingCacheWriteStrategy<TKey, TValue> {
protected readonly hierarchy: IStorageHierarchy<TKey, TValue>;
protected readonly evictQueue: IAgedQueue<TKey>;
protected readonly logger: import("winston").Logger;
/**
* @param hierarchy The storage hierarchy to operate on
* @param evictQueue The keys in the order to evict
*/
constructor(hierarchy: IStorageHierarchy<TKey, TValue>, evictQueue: IAgedQueue<TKey>);
protected executeDelete: (key: TKey, level?: number | undefined) => Promise<IAgingCacheWrite<TValue>>;
protected executeSet: (key: TKey, value: TValue, level?: number | undefined) => Promise<IAgingCacheWrite<TValue>>;
protected setFromHighestLevel: (key: TKey, agedValue: IAgedValue<TValue>) => Promise<IAgingCacheWrite<TValue>>;
protected getWriteStatus(status: IStorageHierarchyWrite<TValue>, level?: number): IAgingCacheWrite<TValue>;
}
//# sourceMappingURL=AgingCacheWriteStrategy.d.ts.map