UNPKG

cnpmcore

Version:
17 lines (16 loc) 539 B
import { QueueAdapter } from '../common/typing'; /** * Use sort set to keep queue in order and keep same value only insert once */ export declare class RedisQueueAdapter implements QueueAdapter { private readonly redis; private getQueueName; private getQueueScoreName; /** * If queue has the same item, return false * If queue not has the same item, return true */ push<T>(key: string, item: T): Promise<boolean>; pop<T>(key: string): Promise<T | null>; length(key: string): Promise<number>; }