UNPKG

murlock

Version:

A distributed locking solution for NestJS, providing a decorator for critical sections with Redis-based synchronization.

22 lines (21 loc) 895 B
/// <reference types="node" /> import { AsyncLocalStorage } from 'async_hooks'; export declare class AsyncStorageManager<T> implements Map<string, T> { private readonly asyncLocalStorage; constructor(asyncLocalStorage?: AsyncLocalStorage<Map<string, T>>); private getStore; register(): void; runWithNewContext<R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs): R; set(key: string, value: T): this; get(key: string): T | undefined; clear(): void; delete(key: string): boolean; forEach(callbackfn: (value: T, key: string, map: Map<string, T>) => void, thisArg?: any): void; has(key: string): boolean; get size(): number; entries(): IterableIterator<[string, T]>; keys(): IterableIterator<string>; values(): IterableIterator<T>; [Symbol.iterator](): IterableIterator<[string, T]>; [Symbol.toStringTag]: string; }