1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Send quit command right away.

The quit/pipeline bug has been fixed in Redis server for some time now.
This commit is contained in:
Matt Ranney
2011-11-13 18:10:22 -10:00
parent c74657cdfa
commit f2a6a20a74

View File

@@ -2,16 +2,23 @@ var redis = require("redis"),
client = redis.createClient(); client = redis.createClient();
client.on("error", function (err) { 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.set("string key", "string val", redis.print);
client.hset("hash key", "hashtest 1", "some value", redis.print); client.hset("hash key", "hashtest 1", "some value", redis.print);
client.hset(["hash key", "hashtest 2", "some other value"], redis.print); client.hset(["hash key", "hashtest 2", "some other value"], redis.print);
client.hkeys("hash key", function (err, replies) { client.hkeys("hash key", function (err, replies) {
if (err) {
return console.error("error response - " + err);
}
console.log(replies.length + " replies:"); console.log(replies.length + " replies:");
replies.forEach(function (reply, i) { replies.forEach(function (reply, i) {
console.log(" " + i + ": " + reply); console.log(" " + i + ": " + reply);
}); });
client.quit(); });
client.quit(function (err, res) {
console.log("Exiting from quit command.");
}); });