How to subscribe to multiple channels on Redis NodeJS

I have a function which I will call from time to time.

function blah() {
   sub.unsubscribe();
   sub.subscribe("a");
   sub.subscribe("b");
}

Above results in error message "Error: node_redis command queue state error."

Same as https://github.com/mranney/node_redis/issues/137

Once a connection is subscribed, it can only issue subscription related commands (subscribe, psubscribe, etc) Might another part of your code be using the same connection? You could also try and subscribe to multiple channels with one call sub.subscribe("a", "b") or subscribe to a pattern that matches your need?