sqs-consumer
Advanced tools
Comparing version 3.7.0 to 3.8.0
@@ -133,2 +133,3 @@ 'use strict'; | ||
// start polling again once all of the messages have been processed | ||
consumer.emit('response_processed'); | ||
consumer._poll(); | ||
@@ -135,0 +136,0 @@ }); |
{ | ||
"name": "sqs-consumer", | ||
"version": "3.7.0", | ||
"version": "3.8.0", | ||
"description": "Build SQS-based Node applications without the boilerplate", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -114,2 +114,3 @@ # sqs-consumer | ||
|`message_processed`|`message`|Fired when a message is successfully processed and removed from the queue.| | ||
|`response_processed`|None|Fired after one batch of items (up to `batchSize`) has been successfully processed.| | ||
|`stopped`|None|Fired when the consumer finally stops its work.| | ||
@@ -116,0 +117,0 @@ |`empty`|None|Fired when the queue is empty (All messages have been consumed).| |
@@ -438,2 +438,33 @@ 'use strict'; | ||
}); | ||
it('fires response_processed event for each batch', function (done) { | ||
sqs.receiveMessage.yieldsAsync(null, { | ||
Messages: [ | ||
{ | ||
ReceiptHandle: 'receipt-handle-1', | ||
MessageId: '1', | ||
Body: 'body-1' | ||
}, | ||
{ | ||
ReceiptHandle: 'receipt-handle-2', | ||
MessageId: '2', | ||
Body: 'body-2' | ||
} | ||
] | ||
}); | ||
handleMessage.yields(null); | ||
consumer = new Consumer({ | ||
queueUrl: 'some-queue-url', | ||
messageAttributeNames: ['attribute-1', 'attribute-2'], | ||
region: 'some-region', | ||
handleMessage: handleMessage, | ||
batchSize: 2, | ||
sqs: sqs | ||
}); | ||
consumer.on('response_processed', done); | ||
consumer.start(); | ||
}); | ||
}); | ||
@@ -440,0 +471,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28649
614
121
9