From 0d195223395989d04668b314197ef0aa8bec4ac6 Mon Sep 17 00:00:00 2001 From: brianc Date: Sun, 1 May 2011 21:35:00 -0500 Subject: [PATCH] code cleanup --- lib/client-pool.js | 18 ------------------ lib/index.js | 1 + 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/lib/client-pool.js b/lib/client-pool.js index 39404a4..ed3793e 100644 --- a/lib/client-pool.js +++ b/lib/client-pool.js @@ -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(); diff --git a/lib/index.js b/lib/index.js index 8652df8..d3eddeb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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'); })