aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/redis/examples/unix_socket.js
blob: 4a5e0bb0e84218dcbfa29db53e9136cca38c3cb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var redis = require("redis"),
    client = redis.createClient("/tmp/redis.sock"),
    profiler = require("v8-profiler");

client.on("connect", function () {
    console.log("Got Unix socket connection.")
});

client.on("error", function (err) {
    console.log(err.message);
});

client.set("space chars", "space value");

setInterval(function () {
    client.get("space chars");
}, 100);

function done() {
    client.info(function (err, reply) {
        console.log(reply.toString());
        client.quit();
    });
}

setTimeout(function () {
    console.log("Taking snapshot.");
    var snap = profiler.takeSnapshot();
}, 5000);