diff --git a/lib/protocol/Connection.js b/lib/protocol/Connection.js
index <HASH>..<HASH> 100644
--- a/lib/protocol/Connection.js
+++ b/lib/protocol/Connection.js
@@ -451,7 +451,7 @@ Connection.prototype.disconnect = function disconnect(cb) {
     self.enqueue(request.disconnect(), done);
   }
 
-  if (this._queue.empty && !this._queue.busy) {
+  if (this.isIdle()) {
     return enqueueDisconnect();
   }
   this._queue.once('drain', enqueueDisconnect);
@@ -558,7 +558,7 @@ Connection.prototype.close = function close() {
   if (this.readyState === 'closed') {
     return;
   }
-  if (this._queue.empty && !this._queue.busy) {
+  if (this.isIdle()) {
     return closeConnection();
   }
   this._queue.once('drain', closeConnection);
@@ -570,6 +570,10 @@ Connection.prototype.destroy = function destroy(err) {
   }
 };
 
+Connection.prototype.isIdle = function isIdle() {
+  return this._queue.empty && !this._queue.busy;
+};
+
 Connection.prototype.setAutoCommit = function setAutoCommit(autoCommit) {
   this._transaction.autoCommit = autoCommit;
 };
Expose connection.IsIdle (#<I>)