diff --git a/lib/client/client.js b/lib/client/client.js index 15820ea..f5ec33b 100644 --- a/lib/client/client.js +++ b/lib/client/client.js @@ -202,12 +202,11 @@ function Client(options) { }; } - this.queuing = (options.queuing !== undefined) ? options.queuing : true; this.queue = new RequestQueue({ size: parseInt((options.queueSize || 0), 10), timeout: parseInt((options.queueTimeout || 0), 10) }); - if (!this.queuing) { + if (options.queueDisable) { this.queue.freeze(); } @@ -1065,7 +1064,7 @@ Client.prototype._send = function _send(message, } if (!this.socket || !this.connected) { if (!this.queue.enqueue(message, expect, emitter, callback)) { - callback(new Error('unable to enqueue request')); + callback(new ConnectionError('connection unavailable')); } // Initiate reconnect if needed if (this.reconnect) {