You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-13 10:02:24 +03:00
43 lines
867 B
TypeScript
43 lines
867 B
TypeScript
import { transformReplyStreamMessages } from './generic-transformers';
|
|
|
|
export const FIRST_KEY_INDEX = 1;
|
|
|
|
export const IS_READ_ONLY = true;
|
|
|
|
interface XPendingRangeOptions {
|
|
IDLE?: number;
|
|
consumer?: string;
|
|
}
|
|
|
|
export function transformArguments(
|
|
key: string,
|
|
group: string,
|
|
start: string,
|
|
end: string,
|
|
count: number,
|
|
options?: XPendingRangeOptions
|
|
): Array<string> {
|
|
const args = ['XPENDING', key, group];
|
|
|
|
if (options?.IDLE) {
|
|
args.push('IDLE', options.IDLE.toString());
|
|
}
|
|
|
|
args.push(start, end, count.toString());
|
|
|
|
if (options?.consumer) {
|
|
args.push(options.consumer);
|
|
}
|
|
|
|
return args;
|
|
}
|
|
|
|
interface XPendingReply {
|
|
messageId: string;
|
|
owner: string;
|
|
msSinceLastDelivery: number;
|
|
deliveriesCounter: number;
|
|
}
|
|
|
|
export const transformReply = transformReplyStreamMessages;
|