sqs-consumer
Advanced tools
Comparing version 5.1.1 to 5.2.0
@@ -33,2 +33,3 @@ import * as SQS from 'aws-sdk/clients/sqs'; | ||
constructor(options: ConsumerOptions); | ||
readonly isRunning: boolean; | ||
static create(options: ConsumerOptions): Consumer; | ||
@@ -35,0 +36,0 @@ start(): void; |
@@ -70,2 +70,5 @@ "use strict"; | ||
} | ||
get isRunning() { | ||
return !this.stopped; | ||
} | ||
static create(options) { | ||
@@ -72,0 +75,0 @@ return new Consumer(options); |
{ | ||
"name": "sqs-consumer", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"description": "Build SQS-based Node applications without the boilerplate", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -118,2 +118,6 @@ # sqs-consumer | ||
### `consumer.isRunning` | ||
Returns the current polling state of the consumer: `true` if it is actively polling, `false` if it is not. | ||
### Events | ||
@@ -120,0 +124,0 @@ |
@@ -122,2 +122,6 @@ const debug = require('debug')('sqs-consumer'); | ||
public get isRunning(): boolean { | ||
return !this.stopped; | ||
} | ||
public static create(options: ConsumerOptions): Consumer { | ||
@@ -124,0 +128,0 @@ return new Consumer(options); |
@@ -612,2 +612,16 @@ import { assert } from 'chai'; | ||
}); | ||
describe('isRunning', async () => { | ||
it('returns true if the consumer is polling', () => { | ||
consumer.start(); | ||
assert.isTrue(consumer.isRunning); | ||
consumer.stop(); | ||
}); | ||
it('returns false if the consumer is not polling', () => { | ||
consumer.start(); | ||
consumer.stop(); | ||
assert.isFalse(consumer.isRunning); | ||
}); | ||
}); | ||
}); |
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
49188
1208
144