title: How to remove Redis on 'message' listeners
body: <p>A typical Redis chat example will go something like this (see <a href="https://github.com/emrahayanoglu/Socket.io-Redis-RealTime-Chat-Example/blob/master/chatServer.js">https://github.com/emrahayanoglu/Socket.io-Redis-RealTime-Chat-Example/blob/master/chatServer.js</a> for just one such example):</p>
  
  <pre><code>io.sockets.on('connection', function (client) { //websocket connection
  
    redis1.subscribe("chat");
  
    redis1.on("message", function(channel, message) {
        console.log(message);
        client.send(message);
    });
  
    client.on('message', function(msg) {
      redis2.publish("chat",msg.message);  
    });
  
    client.on('disconnect', function() {
        redis1.quit();
    });
  });
  </code></pre>
  
  <p>However, the issue here is that when a <code>client</code> 'disconnect', the <code>redis1.on('message',FUNC(){})</code> listener is still attached. The console will continue to print out the <code>message</code>. If one were to inspect the event listners of <code>redis1</code>, they would still find the anonymous function listening. </p>
  
  <p>The issue is that there is no <code>redis1.off(...)</code> function. So, how does one unbind/unsubscribe/delete/remove the redis message listener?</p>
  
  <p>Note: One cannot just do redis1.end(), since that will break the redis connection for other websocket connected users.</p>