@pager/jackrabbit
Advanced tools
Comparing version 4.7.0-rc.1 to 4.7.0
@@ -83,6 +83,8 @@ 'use strict'; | ||
publish(msg, { | ||
var opts = extend({}, { | ||
key: key, | ||
rpcCallback: cb | ||
}); | ||
}, options); | ||
publish(msg, opts); | ||
} | ||
@@ -139,9 +141,8 @@ | ||
function bindKey(key) { | ||
var deferred = Promise.defer(); | ||
channel.bindQueue(newQueue.name, emitter.name, key, {}, function onBind(err, ok) { | ||
if (err) return deferred.reject(err); | ||
return deferred.resolve(ok); | ||
return new Promise(function (resolve, reject) { | ||
channel.bindQueue(newQueue.name, emitter.name, key, {}, function onBind(err, ok) { | ||
if (err) return reject(err); | ||
return resolve(ok); | ||
}); | ||
}); | ||
return deferred.promise; | ||
} | ||
@@ -214,3 +215,3 @@ } | ||
var timeout = setTimeout(() => { | ||
var timeout = setTimeout(function () { | ||
@@ -300,2 +301,2 @@ clearPendingReply(correlationId); | ||
} | ||
} | ||
} |
@@ -16,5 +16,6 @@ var amqp = require('amqplib/callback_api'); | ||
default: createDefaultExchange, | ||
direct: createExchange('direct'), | ||
fanout: createExchange('fanout'), | ||
topic: createExchange('topic'), | ||
direct: createExchange().bind(null, 'direct'), | ||
fanout: createExchange().bind(null, 'fanout'), | ||
topic: createExchange().bind(null, 'topic'), | ||
exchange: createExchange(), | ||
close: close, | ||
@@ -37,2 +38,6 @@ getInternals: getInternals | ||
function close(callback) { | ||
if (!connection) { | ||
if (callback) callback(); | ||
return; | ||
} | ||
try { | ||
@@ -53,8 +58,8 @@ // I don't think amqplib should be throwing here, as this is an async function | ||
function createDefaultExchange() { | ||
return createExchange('direct')(''); | ||
return createExchange()('direct', ''); | ||
} | ||
function createExchange(type) { | ||
return function(name) { | ||
var newExchange = exchange(name, type); | ||
function createExchange() { | ||
return function(type, name, options) { | ||
var newExchange = exchange(name, type, options); | ||
if (connection) { | ||
@@ -78,3 +83,3 @@ newExchange.connect(connection); | ||
channel = undefined; | ||
rabbit.emit('error', err); | ||
if (err) rabbit.emit('error', err); | ||
} | ||
@@ -81,0 +86,0 @@ |
@@ -81,4 +81,9 @@ var amqp = require('amqplib/callback_api'); | ||
function purge(done) { | ||
if (!channel) return; | ||
channel.purgeQueue(emitter.name, onPurged); | ||
if (channel) { | ||
channel.purgeQueue(emitter.name, onPurged); | ||
} else { | ||
emitter.once('ready', function() { | ||
channel.purgeQueue(emitter.name, onPurged); | ||
}); | ||
} | ||
@@ -85,0 +90,0 @@ function onPurged(err, obj) { |
{ | ||
"name": "@pager/jackrabbit", | ||
"version": "4.7.0-rc.1", | ||
"version": "4.7.0", | ||
"description": "Easy RabbitMQ for node", | ||
@@ -32,3 +32,3 @@ "keywords": [ | ||
"lodash.assignin": "4.x.x", | ||
"uuid": "3.x.x" | ||
"uuid": "^3.0.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
15602
442
1
Updateduuid@^3.0.1