Skip to content

Commit

Permalink
Merge pull request #20 from DaPulse/feature/moshik/add_polling_wait_t…
Browse files Browse the repository at this point in the history
…ime_ms_setter

add setter to polling wait time ms
  • Loading branch information
MoshikEilon authored Apr 19, 2022
2 parents 90132aa + 737c075 commit f6d4444
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions dist/consumer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export declare class Consumer extends EventEmitter {
stop(): void;
setBatchSize(newBatchSize: number): void;
setConcurrencyLimit(newConcurrencyLimit: number): void;
setPollingWaitTimeMs(newPollingWaitTimeMs: number): void;
reportMessageFromBatchFinished(message: SQSMessage, error: Error): Promise<void>;
private reportNumberOfMessagesReceived;
private handleSqsResponse;
Expand Down
3 changes: 3 additions & 0 deletions dist/consumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ class Consumer extends events_1.EventEmitter {
this.concurrencyLimit = newConcurrencyLimit;
this.freeConcurrentSlots = newFreeConcurrentSlots;
}
setPollingWaitTimeMs(newPollingWaitTimeMs) {
this.pollingWaitTimeMs = newPollingWaitTimeMs;
}
async reportMessageFromBatchFinished(message, error) {
debug('Message from batch has finished');
this.freeConcurrentSlots++;
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sqs-consumer",
"version": "6.1.0",
"version": "6.2.0",
"description": "Build SQS-based Node applications without the boilerplate",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ export class Consumer extends EventEmitter {
this.freeConcurrentSlots = newFreeConcurrentSlots;
}

public setPollingWaitTimeMs(newPollingWaitTimeMs: number): void {
this.pollingWaitTimeMs = newPollingWaitTimeMs;
}

public async reportMessageFromBatchFinished(message: SQSMessage, error: Error): Promise<void> {
debug('Message from batch has finished');

Expand Down

0 comments on commit f6d4444

Please sign in to comment.