You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use sUnsubscribe in the cluster mode. I find out it supports both string and array. Based on the current implementation, the array type implicitly enforces all the channels to be hashed to the same slot, otherwise an error will throw says ErrorReply: CROSSSLOT Keys in request don't hash to the same slot.
Just checking is that a intentional design or a bug?
S[UN]SUBSCRIBE behaves just like any other command, either use "hash tags" or call SSUBSCRIBE twice:
// make sure both channels are in the same slots using "hash tags"awaitcluster.SSUBSCRIBE(['{tag}1','{tag}2'],(message,channel)=>{console.log(message,channel);});// SSBUCRIBE twice, once for each slotawaitPromise.all([cluster.SSUBSCRIBE('1',(message,channel)=>{console.log(message,channel);}),cluster.SSUBSCRIBE('2',(message,channel)=>{console.log(message,channel);})]);
Description
I'm trying to use
sUnsubscribe
in the cluster mode. I find out it supports both string and array. Based on the current implementation, the array type implicitly enforces all the channels to be hashed to the same slot, otherwise an error will throw saysErrorReply: CROSSSLOT Keys in request don't hash to the same slot
.Just checking is that a intentional design or a bug?
https://github.com/redis/node-redis/blob/master/packages/client/lib/cluster/index.ts#LL372C10-L372C10
Node.js Version
16
Redis Server Version
No response
Node Redis Version
No response
Platform
No response
Logs
The text was updated successfully, but these errors were encountered: