import { ITsQueue } from "../../interfaces/ITsQueue"; import { TsQueueCountOptions, TsQueueCountResult, TsQueueMember, TsQueuePullOptions, TsQueuePullResult } from "../../models/TsQueueModels"; import { DeRedisOptions } from "../../models/DeRedisOptions"; import { BaseRedis } from "../BaseRedis"; /** * class TsQueueService */ export declare class TsQueueService extends BaseRedis implements ITsQueue { /** * @param [portOrPath] {number | string} * @param [hostOrOptions] {string | DeRedisOptions} * @param [options] {DeRedisOptions} */ constructor(portOrPath?: number | string, hostOrOptions?: string | DeRedisOptions, options?: DeRedisOptions); /** * enqueue : insert a time serial data at the end of the queue * * @param channel {string} * @param timestamp {number} timestamp in millisecond * @param data {object} * @returns {Promise} */ enqueue(channel: string, timestamp: number, data: object): Promise; /** * dequeue : peek the first member, remove it from Redis and return it * @param channel {string} * @returns { Promise< TsQueueMember | null > } */ dequeue(channel: string): Promise; /** * get the first member * @param channel {string} * @returns { Promise< TsQueueMember | null > } */ front(channel: string): Promise; /** * peek member based on timestamp or peek the first member * @param channel {string} * @param [timestamp] {number} * @returns { Promise< TsQueueMember | null > } */ peek(channel: string, timestamp?: number): Promise; /** * delete a member by timestamp * * @param channel {string} * @param timestamp {number} * @returns { Promise } */ delete(channel: string, timestamp: number): Promise; /** * remove all members in channel * @param channel {string} */ clear(channel: string): Promise; /** * enqueue : insert a time serial data at the end of the queue * * @param channel {string} * @param timestamp {number} timestamp in millisecond * @param data {object} * @returns {Promise} */ push(channel: string, timestamp: number, data: object): Promise; /** * @param channel {string} * @param startTimestamp {number} timestamp in millisecond. 0 means the beginning of the list * @param endTimestamp {number} timestamp in millisecond. -1 means the last of the list * @param options {TsQueuePullOptions} * @returns {Promise} */ pull(channel: string, startTimestamp: number, endTimestamp: number, options?: TsQueuePullOptions): Promise; /** * @param countOptions {TsQueueCountOptions} * @returns {Promise} */ count(countOptions: TsQueueCountOptions): Promise; /** * Dequeue : remove data from the head of the queue * * remove all the members from head in a sorted set within the given scores * @param channel {string} * @param endTimestamp {number} timestamp in millisecond * @returns {Promise} */ removeFromHead(channel: string, endTimestamp: number): Promise; /** * remove all the members in a sorted set within the given scores * @param channel {string} * @param startTimestamp {number} timestamp in millisecond * @param endTimestamp {number} timestamp in millisecond * @returns {Promise} */ remove(channel: string, startTimestamp: number, endTimestamp: number): Promise; /** * @param key {string} the key of Sorted Set * @param indexOrScore {number} score value, * 0: the first one, the smallest score * -1: the last one, the biggest score * -2: the penultimate element * -3: the third to last element * [timestamp]: normal score * @returns {Promise< TsQueueMember | null >} */ getMember(key: string, indexOrScore: number): Promise; /** * @param key {string} * @param index {number} index value starting from 0 * 0: the first one, the smallest score * -1: the last one, the biggest score * -2: the penultimate element * -3: the third to last element * @returns {Promise< TsQueueMember | null >} */ getMemberByIndex(key: string, index?: number): Promise; /** * figure out the closest member by score * * @param key {string} the key of a sorted set * @param score {number} timestamp * @returns {Promise} */ findClosestMember(key: string, score: number): Promise; /** * return the number of members in a sorted set * * @param channel {string} * @returns { Promise< number > } */ size(channel: string): Promise; } //# sourceMappingURL=TsQueueService.d.ts.map