1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-01 16:46:54 +03:00
Files
node-redis/examples/unix_socket.js
Ruben Bridgewater 7922d4eb85 Small style changes
2015-10-07 16:34:41 +02:00

32 lines
638 B
JavaScript

'use strict';
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.');
profiler.takeSnapshot();
}, 5000);