Skip to content

Instantly share code, notes, and snippets.

@paulgrav
Created August 9, 2012 09:54
Show Gist options
  • Save paulgrav/3302796 to your computer and use it in GitHub Desktop.
Save paulgrav/3302796 to your computer and use it in GitHub Desktop.
Reduced node_redis issue
var redis = require('redis');
var client = redis.createClient(6379,’localhost');
client.subscribe("football.match.event");
client.on("error", function (err) {
console.log("error event - " + client.host + ":" + client.port + " - " + err);
console.log('connected: ' + client.connected);
});
client.on("end", function (err) {
console.log("error event - " + client.host + ":" + client.port + " - " + err);
});
client.on("close", function (err) {
console.log("error event - " + client.host + ":" + client.port + " - " + err);
});
client.on("message", function (channel, message) {
console.log("XXX");
console.log(JSON.parse(message));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment