Skip to content

Commit

Permalink
Send quit command right away.
Browse files Browse the repository at this point in the history
The quit/pipeline bug has been fixed in Redis server for some time now.
  • Loading branch information
mranney committed Nov 14, 2011
1 parent c74657c commit f2a6a20
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions examples/simple.js
Expand Up @@ -2,16 +2,23 @@ var redis = require("redis"),
client = redis.createClient();

client.on("error", function (err) {
console.log("Redis connection error to " + client.host + ":" + client.port + " - " + err);
console.log("error event - " + client.host + ":" + client.port + " - " + err);
});

client.set("string key", "string val", redis.print);
client.hset("hash key", "hashtest 1", "some value", redis.print);
client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
client.hkeys("hash key", function (err, replies) {
if (err) {
return console.error("error response - " + err);
}

console.log(replies.length + " replies:");
replies.forEach(function (reply, i) {
console.log(" " + i + ": " + reply);
});
client.quit();
});

client.quit(function (err, res) {
console.log("Exiting from quit command.");
});

0 comments on commit f2a6a20

Please sign in to comment.