code cleanup
This commit is contained in:
parent
26a85101ce
commit
0d19522339
@ -26,9 +26,6 @@ module.exports = {
|
||||
|
||||
client.once('error', onError);
|
||||
|
||||
//TODO refactor
|
||||
//i don't like reaching into the client's connection for attaching
|
||||
//to specific events here
|
||||
client.once('connect', onReady);
|
||||
}
|
||||
|
||||
@ -41,15 +38,6 @@ module.exports = {
|
||||
return defaults.poolSize;
|
||||
}
|
||||
|
||||
var log = function() {
|
||||
//do nothing
|
||||
}
|
||||
|
||||
//for testing
|
||||
// var log = function() {
|
||||
// console.log.apply(console, arguments);
|
||||
// }
|
||||
|
||||
var getPooledClient = function(config, callback) {
|
||||
//lookup pool using config as key
|
||||
//TODO this don't work so hot w/ object configs
|
||||
@ -57,9 +45,7 @@ module.exports = {
|
||||
|
||||
//create pool if doesn't exist
|
||||
if(!pool) {
|
||||
//log("creating pool %s", config)
|
||||
pool = clientPools[config] = new Pool(defaults.poolSize, function() {
|
||||
//log("creating new client in pool %s", config)
|
||||
var client = new Client(config);
|
||||
client.connected = false;
|
||||
return client;
|
||||
@ -67,7 +53,6 @@ module.exports = {
|
||||
}
|
||||
|
||||
pool.checkOut(function(err, client) {
|
||||
|
||||
//if client already connected just
|
||||
//pass it along to the callback and return
|
||||
if(client.connected) {
|
||||
@ -92,9 +77,6 @@ module.exports = {
|
||||
|
||||
client.once('error', onError);
|
||||
|
||||
//TODO refactor
|
||||
//i don't like reaching into the client's connection for attaching
|
||||
//to specific events here
|
||||
client.once('connect', onReady);
|
||||
|
||||
client.connect();
|
||||
|
@ -11,6 +11,7 @@ module.exports = {
|
||||
defaults: defaults
|
||||
}
|
||||
|
||||
//lazy require native as it may not have been built
|
||||
module.exports.__defineGetter__("native", function() {
|
||||
return require(__dirname + '/native');
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user