From 93fc7fdfc556bfd056d3bfbd07c01d62892e70f7 Mon Sep 17 00:00:00 2001 From: Russ Bradberry Date: Tue, 8 Oct 2013 10:44:27 -0400 Subject: [PATCH] add callback to close method and emit connect [ closes #114 ] --- History.md | 8 ++++++++ lib/pool.js | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 761807e..00d28ac 100644 --- a/History.md +++ b/History.md @@ -204,3 +204,11 @@ * Fixed CQL 3 in v 0.1.x [ @devdazed #93 ] +0.6.3 / 2013-10-08 +================== + + * Support for multiple increments at once [ @natemueller #117 ] + * Fix for collection deserializing [ @industral #96 ] + * Fix for CQL3 UUID escaping [ @industral #98 ] + * Deserialize the key [ @wwwy3y3 #111 ] + * Support latest Node [ @JohnMcLear #116 ] diff --git a/lib/pool.js b/lib/pool.js index d880331..d4a9b5d 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -96,6 +96,7 @@ Pool.prototype.connect = function(callback){ } self.clients.push(connection); if (connected === 1) { + self.emit('connect'); callback(null, keyspace); } if (self.closing) { @@ -335,7 +336,8 @@ Pool.prototype.monitorConnections = function(){ /** * Closes all open connections */ -Pool.prototype.close = function(){ +Pool.prototype.close = function(callback){ + callback = callback || NOOP; var self = this, i = 0, j = 0, len = this.clients.length; // Make sure no intervals get set @@ -351,6 +353,7 @@ Pool.prototype.close = function(){ j += 1; if(j === len){ self.emit('close'); + callback(); } }