From: Jérôme Benoit Date: Fri, 18 Aug 2023 18:58:53 +0000 (+0200) Subject: docs: refine tasks concurrency task queue options description X-Git-Tag: v2.6.29~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=5137e2ae971a1af7de3afc12d4e2c6f5959199f4;p=poolifier.git docs: refine tasks concurrency task queue options description Signed-off-by: Jérôme Benoit --- diff --git a/docs/api.md b/docs/api.md index 7b3766e7..a48f4c54 100644 --- a/docs/api.md +++ b/docs/api.md @@ -93,9 +93,8 @@ An object with these properties: - `tasksQueueOptions` (optional) - The worker tasks queue options object to use in this pool. Properties: - - `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. - - Default: `{ concurrency: 1 }` + - `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. It must be a positive integer. + Default: `{ concurrency: 1 }` #### `ThreadPoolOptions extends PoolOptions` diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 5932b022..dc1fc53f 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -300,7 +300,7 @@ export abstract class AbstractPool< tasksQueueOptions.concurrency <= 0 ) { throw new Error( - `Invalid worker tasks concurrency '${tasksQueueOptions.concurrency}'` + `Invalid worker tasks concurrency '${tasksQueueOptions.concurrency}' is a negative integer or zero` ) } }