UNPKG

rascal

Version:

A config driven wrapper for amqplib supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption, channel pooling and publication timeouts

13 lines (10 loc) 333 B
const debug = require('debug')('rascal:tasks:createChannel'); const _ = require('lodash'); module.exports = _.curry((config, ctx, next) => { debug('Creating channel'); ctx.connection.createChannel((err, channel) => { if (err) return next(err, config, ctx); ctx.channel = channel; next(null, config, ctx); }); });