1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-09 00:22:08 +03:00
Files
node-redis/examples/unix_socket.js
Ruben Bridgewater f1a7bcd735 chore: use standard
2017-05-06 07:06:52 +02:00

34 lines
632 B
JavaScript

'use strict'
var redis = require('redis')
var client = redis.createClient('/tmp/redis.sock')
var 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) {
if (err) throw err
console.log(reply.toString())
client.quit()
})
}
setTimeout(function () {
console.log('Taking snapshot.')
profiler.takeSnapshot()
done()
}, 5000)