From: Jérôme Benoit Date: Tue, 19 Dec 2023 22:10:11 +0000 (+0100) Subject: docs: refine code comments X-Git-Tag: v3.1.7~1^2~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=af7f2788b6fcc39343d544551cf17c8f0dc5b757;hp=c004ececb19646937d2bf9e6431f51fd4108b782;p=poolifier.git docs: refine code comments Signed-off-by: Jérôme Benoit --- 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 (