onirii
Version:
Universal queue SDK
35 lines (34 loc) • 1.18 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AmqpOriginalConfirmChannelWrapper = void 0;
const tslib_1 = require("tslib");
const log_factory_1 = require("../factory/log-factory");
/**
* Amqp Original Channel Standard Data
*/
class AmqpOriginalConfirmChannelWrapper {
/**
* Constructor
*
* @param confirmChannel amqp original confirm channel instance
* @param {string} instanceName instance identify name
*/
constructor(confirmChannel, instanceName) {
this.instanceName = instanceName;
this.channel = confirmChannel;
this.logger = log_factory_1.LogFactory.create(instanceName.substr(0, this.instanceName.lastIndexOf('-')));
this.logger.info(`Creating Channel Wrapper ${this.instanceName}`);
}
/**
* Close current channel
*
* @return {Promise<void>}
*/
close() {
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
yield this.channel.close();
this.logger.warn(`Killed Channel ${this.instanceName}`);
});
}
}
exports.AmqpOriginalConfirmChannelWrapper = AmqpOriginalConfirmChannelWrapper;