amqp-as-promised
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -179,7 +179,7 @@ // Generated by CoffeeScript 1.7.1 | ||
conn.then(function(mq) { | ||
var qname, qp; | ||
var qname, qp, todo; | ||
if (mq.local) { | ||
return def.resolve(true); | ||
} | ||
return Q.all((function() { | ||
todo = (function() { | ||
var _ref, _results; | ||
@@ -190,6 +190,11 @@ _ref = mq._ttQueues; | ||
qp = _ref[qname]; | ||
_results.push(unbind(qname)); | ||
_results.push(qp.then(function(queue) { | ||
if (queue.isAutoDelete()) { | ||
return unbind(qname); | ||
} | ||
})); | ||
} | ||
return _results; | ||
})()).then(function() { | ||
})(); | ||
return Q.all(todo).then(function() { | ||
log.info('closing amqp connection'); | ||
@@ -220,2 +225,4 @@ mq.backoff = mq.reconnect = mq.connect = function() { | ||
this.shift = __bind(this.shift, this); | ||
this.isAutoDelete = __bind(this.isAutoDelete, this); | ||
this.isDurable = __bind(this.isDurable, this); | ||
this.unsubscribe = __bind(this.unsubscribe, this); | ||
@@ -329,2 +336,10 @@ this.subscribe = __bind(this.subscribe, this); | ||
QueueWrapper.prototype.isDurable = function() { | ||
return this.queue.options.durable; | ||
}; | ||
QueueWrapper.prototype.isAutoDelete = function() { | ||
return this.queue.options.autoDelete; | ||
}; | ||
QueueWrapper.prototype.shift = function() { | ||
@@ -331,0 +346,0 @@ return this.queue.shift.apply(this.queue, arguments); |
{ | ||
"name": "amqp-as-promised", | ||
"description": "Promise wrappers for node-amqp", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
37721
476