UNPKG

blue-fish-redis

Version:
10 lines (9 loc) 466 B
import { RedisBin } from '../RedisBin'; export declare class RedisLock { private readonly bin; constructor(bin: RedisBin); start<T>(id: string, worker: () => Promise<T>, ms?: number, interval?: number): Promise<T>; try<T>(id: string, worker: () => Promise<T>, ms?: number): Promise<T>; once<T>(id: string, worker: () => Promise<T>, ms?: number): Promise<void | T>; throttle<T>(id: string, worker: () => Promise<T>, ms: number): Promise<T>; }