Created
February 27, 2014 22:58
-
-
Save miguelmota/9261474 to your computer and use it in GitHub Desktop.
Node.js multiple redis clients. reference: http://stackoverflow.com/questions/13971145/node-redis-redis-clients
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
DB1: redis.createClient(), | |
DB2: redis.createClient(), | |
DB3: redis.createClient(), | |
init: function(next) { | |
var select = redis.RedisClient.prototype.select; | |
require('async').parallel([ | |
select.bind(this.DB1, 1), | |
select.bind(this.DB2, 2), | |
select.bind(this.DB3, 3) | |
], next); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./redis').init(function(err) { | |
if (err) throw err; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment