cnpmcore
Version:
Private NPM Registry for Enterprise
17 lines (16 loc) • 547 B
TypeScript
import type { QueueAdapter } from '../common/typing.ts';
/**
* 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>;
}