aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js
blob: ad1f413228ac60f2f6ea001811dd475389f93d94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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();