From: Jérôme Benoit Date: Mon, 10 Apr 2023 20:09:35 +0000 (+0200) Subject: docs: enhance error message X-Git-Tag: v2.4.7~15 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=243a550a93e278669fe5602aeba92dc8ba11260e;p=poolifier.git docs: enhance error message Signed-off-by: Jérôme Benoit --- 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 }