diff --git a/dist/consumer.d.ts b/dist/consumer.d.ts index 90e1aa09..4493e4b2 100644 --- a/dist/consumer.d.ts +++ b/dist/consumer.d.ts @@ -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; private reportNumberOfMessagesReceived; private handleSqsResponse; diff --git a/dist/consumer.js b/dist/consumer.js index 2f4ff975..b7dfe4eb 100644 --- a/dist/consumer.js +++ b/dist/consumer.js @@ -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++; diff --git a/package-lock.json b/package-lock.json index 20b9e5ec..639fbc60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sqs-consumer", - "version": "5.8.0", + "version": "6.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e4bcabdf..3b983e1e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/consumer.ts b/src/consumer.ts index ed7705d4..df7d7ca3 100644 --- a/src/consumer.ts +++ b/src/consumer.ts @@ -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 { debug('Message from batch has finished');