You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
(docs) add jsdoc comments to command parsers (#2984)
* (docs) bloom: add jsdocs for all commands * (docs) json: add jsdocs * (docs) search: add jsdocs for all commands * (docs) jsdocs for std commands * (docs) jsdoc comments to time series commands
This commit is contained in:
@@ -3,6 +3,13 @@ import { Command, RedisArgument, ReplyUnion } from '../RESP/types';
|
||||
import { XReadStreams, pushXReadStreams } from './XREAD';
|
||||
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)
|
||||
*/
|
||||
export interface XReadGroupOptions {
|
||||
COUNT?: number;
|
||||
BLOCK?: number;
|
||||
@@ -11,6 +18,17 @@ export interface XReadGroupOptions {
|
||||
|
||||
export default {
|
||||
IS_READ_ONLY: true,
|
||||
/**
|
||||
* Constructs the XREADGROUP command to read messages from streams as a consumer group member
|
||||
*
|
||||
* @param parser - The command parser
|
||||
* @param group - Name of the consumer group
|
||||
* @param consumer - Name of the consumer in the group
|
||||
* @param streams - Single stream or array of streams to read from
|
||||
* @param options - Additional options for reading streams
|
||||
* @returns Array of stream entries, each containing the stream name and its messages
|
||||
* @see https://redis.io/commands/xreadgroup/
|
||||
*/
|
||||
parseCommand(
|
||||
parser: CommandParser,
|
||||
group: RedisArgument,
|
||||
@@ -34,6 +52,9 @@ export default {
|
||||
|
||||
pushXReadStreams(parser, streams);
|
||||
},
|
||||
/**
|
||||
* Transform functions for different RESP versions
|
||||
*/
|
||||
transformReply: {
|
||||
2: transformStreamsMessagesReplyResp2,
|
||||
3: undefined as unknown as () => ReplyUnion
|
||||
|
Reference in New Issue
Block a user