Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = QueueMessageDispatcher;
var Consumer = require('sqs-consumer'),
AWS = require('aws-sdk'),
Q = require('q');
/**
* We need to override the parent method, to prevent the consumer of deleting the message.
*
* @param message
* @param cb
* @private
*/
Consumer.prototype._deleteMessage = function (message, cb) {
cb();
};
/**
* QueueMessageDispatcher is the chain element between the queue and the event dispatcher. It provides a small
* set of functions to interact with the queue and register for queue messages.
*
* @param eventEmitter
* @constructor
*/
function QueueMessageDispatcher(eventEmitter) {
this.eventEmitter = eventEmitter;
this.consumer = {};
this.endpoints = {};
}