Socket
Socket
Sign inDemoInstall

sqs-consumer

Package Overview
Dependencies
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqs-consumer - npm Package Compare versions

Comparing version 3.1.3 to 3.2.0

2

index.js

@@ -114,2 +114,4 @@ 'use strict';

this.sqs.receiveMessage(receiveParams, this._handleSqsResponseBound);
} else {
this.emit('stopped');
}

@@ -116,0 +118,0 @@ };

4

package.json
{
"name": "sqs-consumer",
"version": "3.1.3",
"version": "3.2.0",
"description": "Build SQS-based Node applications without the boilerplate",

@@ -32,3 +32,3 @@ "main": "index.js",

"mocha": "^2.0.1",
"codeclimate-test-reporter": "0.3.1",
"codeclimate-test-reporter": "0.3.3",
"sinon": "^1.10.3"

@@ -35,0 +35,0 @@ },

@@ -114,1 +114,2 @@ # sqs-consumer

|`message_processed`|`message`|Fired when a message is successfully processed and removed from the queue.|
|`stopped`|None|Fired when the consumer finally stops its work.|

@@ -338,6 +338,8 @@ 'use strict';

describe('.stop', function () {
it('stops the consumer polling for messages', function (done) {
beforeEach(function () {
sqs.receiveMessage.onSecondCall().yieldsAsync(null, response);
sqs.receiveMessage.onThirdCall().returns();
});
it('stops the consumer polling for messages', function (done) {
consumer.start();

@@ -351,3 +353,49 @@ consumer.stop();

});
it('fires a stopped event when last poll occurs after stopping', function (done) {
var handleStop = sinon.stub().returns();
consumer.on('stopped', handleStop);
consumer.start();
consumer.stop();
setTimeout(function () {
sinon.assert.calledOnce(handleStop);
done();
}, 10);
});
it('fires a stopped event only once when stopped multiple times', function (done) {
var handleStop = sinon.stub().returns();
consumer.on('stopped', handleStop);
consumer.start();
consumer.stop();
consumer.stop();
consumer.stop();
setTimeout(function () {
sinon.assert.calledOnce(handleStop);
done();
}, 10);
});
it('fires a stopped event a second time if started and stopped twice', function (done) {
var handleStop = sinon.stub().returns();
consumer.on('stopped', handleStop);
consumer.start();
consumer.stop();
consumer.start();
consumer.stop();
setTimeout(function () {
sinon.assert.calledTwice(handleStop);
done();
}, 10);
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc