UNPKG

redis-semaphore

Version:

Distributed mutex and semaphore based on Redis

11 lines (10 loc) 463 B
import RedisSemaphore from './RedisSemaphore'; import { LockOptions, RedisClient } from './types'; export default class RedisMultiSemaphore extends RedisSemaphore { protected _kind: string; protected _permits: number; constructor(client: RedisClient, key: string, limit: number, permits: number, options?: LockOptions); protected _refresh(): Promise<boolean>; protected _acquire(): Promise<boolean>; protected _release(): Promise<void>; }