node close rabbitmq connection
async sendMsg(msg) {
const channel = await this.initChannel();
const sendResult = channel.sendToQueue(this.queue, Buffer.from(msg), {
persistent: true,
});
if (!sendResult) {
await new Promise((resolve) => channel.once('drain', () => resolve));
}
}
async close() {
if (this.channel) await this.channel.close();
await this.conn.close();
}
Also in JavaScript:
- loop key in object
- delete local storage javascript
- json boolean
- html video tag autoplay not working
- how to declare variables javascript
- validador de cep javascript
- random color in javascript
- javascript select element with two classes
- mongoose connection nodejs
- array in javascript
- select2 destroy
- how do i check if JQuery checkbox is checked
- click left event listener javascrip
- character to ascii in js
- how to setItem and getItem in javascript in localStorage
- dumpdata json model dajngo
- js add delay with promises
- does json only support ascii
- jquery onclick function show alert
- string split javascript newline
- encode url javascript
- countdown in javascript
- how to check if a key exists in an object javascript
- mongodb unwind