Can't execute commands by client subscribed to channel #563

Closed
moein7tl opened this Issue Mar 11, 2014 · 1 comment

Projects

None yet

3 participants

@moein7tl

I can't execute more than one command by same client which subscribed to channel,it works if I create new client,one for listening and another for executing commands.

var redis   =   require('redis'),
    client  =   redis.createClient(),
client.get("KEY1",function(err,reply){
    console.log(reply); // echo null
    client.get("KEY2",function(err,reply){
        console.log(reply); this line doesn't execute
    });
});
client.on('message',function(channel,message){
});
client.subscribe(CONFIG.CHANNEL_INIT_PUBLISHER);  

I use hredis and node v0.10.12

@brycebaril
NodeRedis member

Hi @moein7tl -- this is due to the way Redis clients work. Once a client goes into "subscriber" mode the server will not allow it to send any commands. It is all documented in the README.

@brycebaril brycebaril closed this Mar 11, 2014
@BridgeAR BridgeAR added the question label Oct 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment