Reverting because this was a documentation problem, not a problem with
the code. Performance-wise, this is faster than the approach in #345, though
it may cause users more trouble. This is okay, if someone opens an issue we
can point them to the docs.
This reverts commit b60e001fa0.
Conflicts:
index.js
test.js
This fixes an issue where the command queue gets popped prematurely by pubsub
messages, leading to callbacks for those commands not being invoked.
Close#360.
Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
RedisClient might enter pub/sub mode after at least one SELECT command issued.
When reconnecting, the SELECT command is issued after restoring pub_sub_command to true, which causes an exception.
An uncaught exception will be raised when the retry timer tries to
reconnect and encounter an error, for all event listeners of the stream
were removed in line 826. It should set closing varable to be true.
Also adds a test that uses SADD in caps. Nicely enough, this makes
multi_bench.js run just a tiny bit faster :)
Signed-off-by: DTrejo <david.trejo@voxer.com>
This change stores the connection state regarding subscriptions,
selected db and monitoring. When the connection to Redis drops, the state
is reestablished after a succesful reconnect. Fixes#241. Fixes#210.
Signed-off-by: DTrejo <david.trejo@voxer.com>
This is achieved by introducing a new option to the createClient method called bufferedInput.
If bufferedInput is set to true, then the returned data will be a Buffer if the command argument passed is a buffer
E.g.
var redis = require("redis"),
client = redis.createClient(<port>, <host>, {buffered_input: true});
client.set("foo_rand000000000000", "OK");
// The below get request will return a utf8 string
client.get("foo_rand000000000000", function (err, reply) {
console.log(reply.toString()); // Will print `OK`
});
// The below get request will return a Buffer as the key is specified as a Buffer
client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
console.log(reply.toString()); // Will print `<Buffer 4f 4b>`
});
client.end();