Skip to content

Commit

Permalink
Modified transaction
Browse files Browse the repository at this point in the history
Signed-off-by: Yi-Pin Chen <[email protected]>
  • Loading branch information
yipin-chen committed Aug 29, 2024
1 parent 7eb1238 commit 43c3db7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions node/src/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3865,11 +3865,11 @@ export class BaseTransaction<T extends BaseTransaction<T>> {
*
* @see {@link https://valkey.io/commands/pubsub-numsub/|valkey.io} for more details.
*
* @param channels - The list of channels to query for the number of subscribers.
* @param channels - (Optional) The list of channels to query for the number of subscribers.
*
* Command Response - A list of the channel names and their numbers of subscribers.
*/
public pubsubNumSub(channels?: string[]): T {
public pubsubNumSub(channels?: GlideString[]): T {
return this.addAndReturn(createPubSubNumSub(channels));
}
}
Expand Down Expand Up @@ -4176,16 +4176,14 @@ export class ClusterTransaction extends BaseTransaction<ClusterTransaction> {
/**
* Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified shard channels.
*
* Note that it is valid to call this command without channels. In this case, it will just return an empty map.
* The command is routed to all nodes, and aggregates the response to a single map of the channels and their number of subscriptions.
*
* @see {@link https://valkey.io/commands/pubsub-shardnumsub|valkey.io} for more details.
* @remarks When in cluster mode, the command is routed to all nodes, and aggregates the response into a single list.
*
* @param channels - The list of shard channels to query for the number of subscribers.
* If not provided, returns an empty map.
* @returns A map where keys are the shard channel names and values are the number of subscribers.
* @param channels - (Optional) The list of shard channels to query for the number of subscribers.
* If not provided, returns an empty map.
* @returns A list of the shard channel names and their numbers of subscribers.
*/
public pubsubShardNumSub(channels?: string[]): ClusterTransaction {
public pubsubShardNumSub(channels?: GlideString[]): ClusterTransaction {
return this.addAndReturn(createPubSubShardNumSub(channels));
}
}

0 comments on commit 43c3db7

Please sign in to comment.