How to use the amqplib/lib/callback_model.Channel function in amqplib

To help you get started, we’ve selected a few amqplib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github arobson / rabbot / src / amqp / channel.js View on Github external
const AmqpChannel = require('amqplib/lib/callback_model').Channel;
const monad = require('./iomonad.js');
const log = require('../log')('rabbot.channel');

/* log
  * `rabbot.channel`
    * `debug`
      * when amqplib's `channel.close` promise is rejected
*/

function close (name, channel) {
  if (channel.close) {
    return channel.close()
      .then(null, function (err) {
        // since calling close on channel could reject the promise
        // (see connection close's comment) this catches and logs it
        // for debug level

amqplib

An AMQP 0-9-1 (e.g., RabbitMQ) library and client.

MIT
Latest version published 28 days ago

Package Health Score

91 / 100
Full package analysis