promise-pool-ext
Advanced tools
Comparing version 3.1.0 to 3.2.0
@@ -6,3 +6,4 @@ import Joi from 'joi-strict'; | ||
Joi.assert(opt, Joi.object().keys({ | ||
timeout: Joi.number().integer().min(0).optional() | ||
timeout: Joi.number().integer().min(0).optional(), | ||
debounce: Joi.boolean().optional() | ||
})); | ||
@@ -24,3 +25,4 @@ | ||
if (task.done === true) { | ||
tasks.shift(); | ||
const deleteCount = opt.debounce === true ? Math.max(1, tasks.length - 1) : 1; | ||
tasks.splice(0, deleteCount); | ||
work(); | ||
@@ -27,0 +29,0 @@ return; |
{ | ||
"name": "promise-pool-ext", | ||
"type": "module", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -95,2 +95,4 @@ # promise-pool-ext | ||
Not supported for SeqWorker (since it is always one) | ||
#### timeout: Integer = undefined | ||
@@ -102,2 +104,8 @@ | ||
#### debounce: Boolean = undefined | ||
Only supported for SeqWorker. | ||
When set to true, will skip any queued tasks if there are subsequent ones. | ||
## Errors | ||
@@ -104,0 +112,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
13520
225
118