You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-12-12 21:21:15 +03:00
feat(xreadgroup): add claim attribute (#3122)
* feat(xreadgroup): add claim attribute the CLAIM attribute can be used to instruct redis to return PEL ( Pending Entries List ) entries with their respective deliveries and ms since last delivery * remove m01 from test matrix * add jsdoc
This commit is contained in:
committed by
GitHub
parent
130e88d45c
commit
5a0a06df69
@@ -5,15 +5,17 @@ import { transformStreamsMessagesReplyResp2 } from './generic-transformers';
|
||||
|
||||
/**
|
||||
* Options for the XREADGROUP command
|
||||
*
|
||||
*
|
||||
* @property COUNT - Limit the number of entries returned per stream
|
||||
* @property BLOCK - Milliseconds to block waiting for new entries (0 for indefinite)
|
||||
* @property NOACK - Skip adding the message to the PEL (Pending Entries List)
|
||||
* @property CLAIM - Prepend PEL entries that are at least this many milliseconds old
|
||||
*/
|
||||
export interface XReadGroupOptions {
|
||||
COUNT?: number;
|
||||
BLOCK?: number;
|
||||
NOACK?: boolean;
|
||||
CLAIM?: number;
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -50,6 +52,10 @@ export default {
|
||||
parser.push('NOACK');
|
||||
}
|
||||
|
||||
if (options?.CLAIM !== undefined) {
|
||||
parser.push('CLAIM', options.CLAIM.toString());
|
||||
}
|
||||
|
||||
pushXReadStreams(parser, streams);
|
||||
},
|
||||
/**
|
||||
@@ -59,5 +65,4 @@ export default {
|
||||
2: transformStreamsMessagesReplyResp2,
|
||||
3: undefined as unknown as () => ReplyUnion
|
||||
},
|
||||
unstableResp3: true,
|
||||
} as const satisfies Command;
|
||||
|
||||
Reference in New Issue
Block a user