@cleotasks/core
Version:
A distributed task queue system for Node.js, inspired by Celery and BullMQ
11 lines (10 loc) • 469 B
TypeScript
import { Redis } from 'ioredis';
export declare class GroupLock {
private redis;
constructor(redis: Redis);
acquireLock(groupName: string, holder: string, ttlMs?: number): Promise<boolean>;
releaseLock(groupName: string, holder: string): Promise<void>;
isLocked(groupName: string): Promise<boolean>;
getLockHolder(groupName: string): Promise<string | null>;
extendLock(groupName: string, holder: string, ttlMs?: number): Promise<boolean>;
}