From 5137e2ae971a1af7de3afc12d4e2c6f5959199f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 18 Aug 2023 20:58:53 +0200 Subject: [PATCH] docs: refine tasks concurrency task queue options description MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- docs/api.md | 5 ++--- src/pools/abstract-pool.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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` ) } } -- 2.34.1