import { type RedisCommands } from "https://deno.land/x/redis@v0.34.0/mod.ts";
Methods
Returns the index of the first matching element inside a list.
If no match is found, this method returns undefined
.
Returns the indexes of the first N matching elements inside a list. If no match is found. this method returns an empty array.
The XACK command removes one or multiple messages from the pending entries list (PEL) of a stream consumer group. A message is pending, and as such stored inside the PEL, when it was delivered to some consumer, normally as a side effect of calling XREADGROUP, or when a consumer took ownership of a message calling XCLAIM. The pending message was delivered to some consumer but the server is yet not sure it was processed at least once. So new calls to XREADGROUP to grab the messages history for a consumer (for instance using an XId of 0), will return such message. Similarly the pending message will be listed by the XPENDING command, that inspects the PEL.
Once a consumer successfully processes a message, it should call XACK so that such message does not get processed again, and as a side effect, the PEL entry about this message is also purged, releasing memory from the Redis server.
Write a message to a stream.
Returns bulk string reply, specifically: The command returns the XId of the added entry. The XId is the one auto-generated if * is passed as XId argument, otherwise the command just returns the same XId specified by the user during insertion.
Write a message to a stream.
Returns bulk string reply, specifically: The command returns the XId of the added entry. The XId is the one auto-generated if * is passed as XId argument, otherwise the command just returns the same XId specified by the user during insertion.
In the context of a stream consumer group, this command changes the ownership of a pending message, so that the new owner is the consumer specified as the command argument.
It returns the claimed messages unless called with the JUSTIDs option, in which case it returns only their XIds.
This is a complex command! Read more at https://redis.io/commands/xclaim
Removes the specified entries from a stream, and returns the number of entries deleted, that may be different from the number of XIds passed to the command in case certain XIds do not exist.
This command is used to create a new consumer group associated with a stream.
Delete a specific consumer from a group, leaving the group itself intact.
Destroy a consumer group completely. The consumer group will be destroyed even if there are active consumers and pending messages, so make sure to call this command only when really needed.
A support command which displays text about the various subcommands in XGROUP.
Finally it possible to set the next message to deliver using the SETID subcommand. Normally the next XId is set when the consumer is created, as the last argument of XGROUP CREATE. However using this form the next XId can be modified later without deleting and creating the consumer group again. For instance if you want the consumers in a consumer group to re-process all the messages in a stream, you may want to set its next ID to 0:
returns the entire state of the stream, including entries, groups, consumers and PELs. This form is available since Redis 6.0.
Get as output all the consumer groups associated with the stream.
Get the list of every consumer in a specific consumer group.
Returns the number of entries inside a stream. If the specified key does not exist the command returns zero, as if the stream was empty. However note that unlike other Redis types, zero-length streams are possible, so you should call TYPE or EXISTS in order to check if a key exists or not.
Complex command to obtain info on messages in the Pending Entries List.
Outputs a summary about the pending messages in a given consumer group.
Output more detailed info about pending messages:
- The ID of the message.
- The name of the consumer that fetched the message and has still to acknowledge it. We call it the current owner of the message.
- The number of milliseconds that elapsed since the last time this message was delivered to this consumer.
- The number of times this message was delivered.
If you pass the consumer argument to the command, it will efficiently filter for messages owned by that consumer.
The command returns the stream entries matching a given range of XIds. The range is specified by a minimum and maximum ID. All the entries having an XId between the two specified or exactly one of the two XIds specified (closed interval) are returned.
The command also has a reciprocal command returning items in the reverse order, called XREVRANGE, which is otherwise identical.
The - and + special XIds mean respectively the minimum XId possible and the maximum XId possible inside a stream, so the following command will just return every entry in the stream.
This command is exactly like XRANGE, but with the notable difference of returning the entries in reverse order, and also taking the start-end range in reverse order: in XREVRANGE you need to state the end XId and later the start ID, and the command will produce all the element between (or exactly like) the two XIds, starting from the end side.
Read data from one or multiple streams, only returning entries with an XId greater than the last received XId reported by the caller.
The XREADGROUP command is a special version of the XREAD command with support for consumer groups.
Trims the stream to the indicated number of elements.
This command controls the tracking of the keys in the next command executed by the connection.
Returns the name of the current connection which can be set by clientSetName
.
Returns the client ID we are redirecting our tracking notifications to.
Returns the id of the current redis connection.
Returns information and statistics about the current client connection in a mostly human readable format.
Closes a given client connection.
Returns information and statistics about the client connections server in a mostly human readable format.
Suspend all the Redis clients for the specified amount of time (in milliseconds).
Sets a connectionName
to the current connection.
You can get the name of the current connection using clientGetName()
.
Enables the tracking feature for the Redis server that is used for server assisted client side caching.
Returns information about the current client connection's use of the server assisted client side caching feature.
This command can unblock, from a different connection, a client blocked in a blocking operation.
Used to resume command processing for all clients that were paused by clientPause
.