Socket
Socket
Sign inDemoInstall

amqper

Package Overview
Dependencies
32
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.1 to 0.5.2

49

lib/client.js

@@ -117,25 +117,32 @@ "use strict";

close(cb) {
if (this.closing || this.closed) {
if (cb) cb();
return PromiseA.resolve();
close(delay, cb) {
if (typeof delay === 'function') {
cb = delay;
delay = null;
}
return this.$promise.finally(() => {
this.closing = true;
const that = this;
return close_connection(this.conn).then(function () {
return PromiseA.all(PromiseA.map(that.routers, function (router) {
return router.connection.then(function (conn) {
if (conn === that.conn) return;
return close_connection(conn);
});
}));
}).then(function () {
that.routers = [];
that.closed = true;
that.closing = false;
if (cb) cb();
});
if (this.closing) {
return this.closing.asCallback(cb);
}
const p = delay ? PromiseA.fromCallback(cb => setTimeout(cb, parseInt(delay))) : PromiseA.resolve();
return this.closing = p.then(() => {
return this.$promise
.then()
.then(() => {
return PromiseA.all(PromiseA.map(this.routers, (router) => {
return router.connection.then((conn) => {
if (conn === this.conn) return;
return close_connection(conn);
});
}));
})
.then(() => close_connection(this.conn))
.then(() => {
this.routers = [];
this.closed = true;
this.closing = null;
})
.asCallback(cb);
});
};
}
}

@@ -142,0 +149,0 @@

{
"name": "amqper",
"version": "0.5.1",
"version": "0.5.2",
"description": "A simple and elegant AMQP client for node based on amqplib.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/taoyuan/amqper",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc