amqp-as-promised
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -24,3 +24,5 @@ // Generated by CoffeeScript 1.7.1 | ||
var _ref; | ||
return ev.value.def.reject(new Error("timeout: " + ((_ref = ev.options) != null ? _ref.info : void 0))); | ||
if (typeof (ev != null ? (_ref = ev.value) != null ? _ref.reject : void 0 : void 0) === 'function') { | ||
return ev.value.reject(new Error('timeout')); | ||
} | ||
}); | ||
@@ -48,11 +50,6 @@ } | ||
Rpc.prototype.registerResponse = function(corrId, options) { | ||
var def, value; | ||
Rpc.prototype.registerResponse = function(corrId, timeout) { | ||
var def; | ||
def = Q.defer(); | ||
options = options || {}; | ||
value = { | ||
def: def, | ||
options: options | ||
}; | ||
this.responses.set(corrId, value, options.timeout); | ||
this.responses.set(corrId, def, timeout); | ||
return def; | ||
@@ -63,3 +60,3 @@ }; | ||
if (this.responses.get(corrId)) { | ||
this.responses.get(corrId).def.resolve(msg); | ||
this.responses.get(corrId).resolve(msg); | ||
return this.responses.remove(corrId); | ||
@@ -77,5 +74,3 @@ } | ||
id = uuid.v4(); | ||
options = options || {}; | ||
options.info = options.info || ("" + exname + "/" + routingKey); | ||
def = _this.registerResponse(id, options); | ||
def = _this.registerResponse(id, options != null ? options.timeout : void 0); | ||
opts = { | ||
@@ -82,0 +77,0 @@ replyTo: q.name, |
{ | ||
"name": "amqp-as-promised", | ||
"description": "Promise wrappers for node-amqp", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": { | ||
@@ -29,3 +29,3 @@ "type": "git", | ||
"bog": "1.0.0", | ||
"mem-cache": "0.0.3" | ||
"mem-cache": "0.0.4" | ||
}, | ||
@@ -32,0 +32,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43162
492
+ Addedmem-cache@0.0.4(transitive)
- Removedmem-cache@0.0.3(transitive)
Updatedmem-cache@0.0.4