Skip to content
Browse files

Send quit command right away.

The quit/pipeline bug has been fixed in Redis server for some time now.
  • Loading branch information...
1 parent c74657c commit f2a6a20a74ec2d090ca4d7d9362add6765c487cd @mranney mranney committed
Showing with 9 additions and 2 deletions.
  1. +9 −2 examples/simple.js
View
11 examples/simple.js
@@ -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.
Something went wrong with that request. Please try again.