Below command only gives channel list .
127.0.0.1:6379> PUBSUB CHANNELS
1) "mychannel"
2) "mychanne2"
How to LIST subscribers subscribed on channel1 OR channel2 .?
also
i din't found redis command to list all subscribers Of a particular channel
Below command only gives channel list .
127.0.0.1:6379> PUBSUB CHANNELS
1) "mychannel"
2) "mychanne2"
How to LIST subscribers subscribed on channel1 OR channel2 .?
also
i din't found redis command to list all subscribers Of a particular channel
Share Improve this question edited Feb 11, 2016 at 20:24 Jonatas Walker 14.2k6 gold badges56 silver badges82 bronze badges asked Feb 11, 2016 at 17:14 Mr punchMr punch 1,9064 gold badges18 silver badges23 bronze badges 02 Answers
Reset to default 10You can use PUBSUB NUMSUB channel1
OR PUBSUB NUMSUB channel2
and get reply about the number of subscribers for the specified channel.
I can achieve this with something like:
redis_client.multi().client(['list']).exec(function(err, results) {
var pairs = results[0].split(' ');
pairs.forEach(function(pair){
var kv = pair.split('=');
if (kv[0] == 'name' && kv[1] == constants.REDIS_SUBSCRIBER_NAME)
found = true;
});
if (found) // some logic
else // some logic
});