From 243a550a93e278669fe5602aeba92dc8ba11260e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 10 Apr 2023 22:09:35 +0200 Subject: [PATCH] docs: enhance error message MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 2 +- src/pools/pool-internal.ts | 6 ++++++ .../selection-strategies/selection-strategies-types.ts | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 1fd9a173..99f65a24 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -142,7 +142,7 @@ export abstract class AbstractPool< if (this.opts.enableTasksQueue) { if ((opts.tasksQueueOptions?.concurrency as number) <= 0) { throw new Error( - `Invalid tasks queue concurrency '${ + `Invalid worker tasks concurrency '${ (opts.tasksQueueOptions as TasksQueueOptions).concurrency as number }'` ) diff --git a/src/pools/pool-internal.ts b/src/pools/pool-internal.ts index 8912dd2c..b245e360 100644 --- a/src/pools/pool-internal.ts +++ b/src/pools/pool-internal.ts @@ -7,7 +7,13 @@ import type { IWorker, WorkerNode } from './worker' * @enum */ export enum PoolType { + /** + * Fixed pool type. + */ FIXED = 'fixed', + /** + * Dynamic pool type. + */ DYNAMIC = 'dynamic' } diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 23dc5e8c..7fbe40f2 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -43,8 +43,17 @@ export interface WorkerChoiceStrategyOptions { * Pool worker tasks usage statistics requirements. */ export interface RequiredStatistics { + /** + * Require tasks run time. + */ runTime: boolean + /** + * Require tasks average run time. + */ avgRunTime: boolean + /** + * Require tasks median run time. + */ medRunTime: boolean } -- 2.34.1