rsxjs
Version:
Resilience Extensions for JS.
26 lines (25 loc) • 1.16 kB
TypeScript
/**
* @file src/store/memory.ts
* @description Memory store.
* @copyright 2018-present Karim Alibhai. All rights reserved.
*/
import { Store, SetOptions } from './store';
export declare class MemoryStore implements Store {
private readonly map;
incr(key: string): Promise<void>;
decr(key: string): Promise<void>;
get<T>(key: string): Promise<T | void>;
set<T>(key: string, value: T, options?: SetOptions): Promise<void>;
del(key: string): Promise<void>;
hget<T>(namespace: string, key: string): Promise<T | void>;
hget<T>(namespace: string, key: string, defaultValue: T): Promise<T>;
hset<T>(namespace: string, key: string, value: T): Promise<void>;
hincr(namespace: string, key: string): Promise<void>;
hdecr(namespace: string, key: string): Promise<void>;
rpush<T>(listName: string, value: T): Promise<number>;
lpush<T>(listName: string, value: T): Promise<number>;
rpop<T>(listName: string): Promise<T | void>;
lpop<T>(listName: string): Promise<T | void>;
brpop<T>(listName: string, timeout: number): Promise<T | void>;
blpop<T>(listName: string, timeout: number): Promise<T | void>;
}