From af7f2788b6fcc39343d544551cf17c8f0dc5b757 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 19 Dec 2023 23:10:11 +0100 Subject: [PATCH] docs: refine code comments 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 | 10 +++++----- .../worker-choice-strategy-context.ts | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 56bd0348..cc9408f2 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -191,20 +191,20 @@ export abstract class AbstractPool< } } - private checkMinimumNumberOfWorkers (numberOfWorkers: number): void { - if (numberOfWorkers == null) { + private checkMinimumNumberOfWorkers (minimumNumberOfWorkers: number): void { + if (minimumNumberOfWorkers == null) { throw new Error( 'Cannot instantiate a pool without specifying the number of workers' ) - } else if (!Number.isSafeInteger(numberOfWorkers)) { + } else if (!Number.isSafeInteger(minimumNumberOfWorkers)) { throw new TypeError( 'Cannot instantiate a pool with a non safe integer number of workers' ) - } else if (numberOfWorkers < 0) { + } else if (minimumNumberOfWorkers < 0) { throw new RangeError( 'Cannot instantiate a pool with a negative number of workers' ) - } else if (this.type === PoolTypes.fixed && numberOfWorkers === 0) { + } else if (this.type === PoolTypes.fixed && minimumNumberOfWorkers === 0) { throw new RangeError('Cannot instantiate a fixed pool with zero worker') } } diff --git a/src/pools/selection-strategies/worker-choice-strategy-context.ts b/src/pools/selection-strategies/worker-choice-strategy-context.ts index 50c3f9c8..1de78aba 100644 --- a/src/pools/selection-strategies/worker-choice-strategy-context.ts +++ b/src/pools/selection-strategies/worker-choice-strategy-context.ts @@ -224,6 +224,7 @@ export class WorkerChoiceStrategyContext< /** * Sets the worker choice strategies in the context options. * + * @param pool - The pool instance. * @param opts - The worker choice strategy options. */ public setOptions ( -- 2.34.1