1
0
Fork 0
Youpp/Youpp.app/Contents/Resources/app.nw/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js

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();