title: limitation in the callback function in nodejs redis?
body: <p>I am not sure if the issue I am having is a limitation in redis itself or in the nodejs 'redis' module implementation.</p>
  
  <pre><code>var redis = require('redis');
  var client = redis.createClient(6379,'192.168.200.5');
  
  client.on('error',function (error) {
      console.log("** error in connection **");
      process.exit(1);
  });
  
  client.on('connect',function () {
      console.log("** connected **");
  
      client.on('message',function (channel,message) {
          if (channel == 'taskqueue') {
              console.log(channel + ' --&gt; ' + message);
              var params = message.split(' ');
              var inputf = params[0];
              var outputf = params[1];
              var dim = inputf.split('_').slice(-1)[0];
  
              client.rpush('records',message,function (e,reply) {
  
              });
          }
      });
  
      client.subscribe('taskqueue');
  });
  </code></pre>
  
  <p>From the code snippet above, I tried to do an RPUSH inside an "ON MESSAGE" subscription event. It does not work, and I get a client 'ON ERROR' event, thus, it prints error in connection. What is the correct way to do this?</p>