docs: refine tasks concurrency task queue options description
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Aug 2023 18:58:53 +0000 (20:58 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 18 Aug 2023 18:58:53 +0000 (20:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
docs/api.md
src/pools/abstract-pool.ts

index 7b3766e72cc0978901ac6df7ddfd70bcc9d826ef..a48f4c54c3977dadade267f0ef5ca50e3ae22fda 100644 (file)
@@ -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`
 
index 5932b022230a3ce18c69a803d6efaa596f1cb736..dc1fc53f90bfbda6031a56cfd2c92e62867f07ec 100644 (file)
@@ -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`
       )
     }
   }