1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/tests/sub_quit_test.js
Matt Ranney f10ff9e916 Lots of bugs fixed.
*  connection error did not properly trigger reconnection logic [GH-85]
*  client.hmget(key, [val1, val2]) was not expanding properly [GH-66]
*  client.quit() while in pub/sub mode would throw an error [GH-87]
*  client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92]
2011-04-21 16:48:14 -10:00

19 lines
507 B
JavaScript

var client = require("redis").createClient(),
client2 = require("redis").createClient();
client.subscribe("something");
client.on("subscribe", function (channel, count) {
console.log("Got sub: " + channel);
client.unsubscribe("something");
});
client.on("unsubscribe", function (channel, count) {
console.log("Got unsub: " + channel + ", quitting");
client.quit();
});
// exercise unsub before sub
client2.unsubscribe("something");
client2.subscribe("another thing");
client2.quit();