X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=cc9408f2fed30acb97a0dfdca34d0994c245227e;hb=af7f2788b6fcc39343d544551cf17c8f0dc5b757;hp=ebc7b5d95f1d3fd84bb00ff0b689bc8ce18bade9;hpb=26ce26ca8861318068427cc86697103e7a3ddbf4;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index ebc7b5d9..cc9408f2 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -131,9 +131,9 @@ export abstract class AbstractPool< * Constructs a new poolifier pool. * * @param minimumNumberOfWorkers - Minimum number of workers that this pool should manage. - * @param maximumNumberOfWorkers - Maximum number of workers that this pool should manage. * @param filePath - Path to the worker file. * @param opts - Options for the pool. + * @param maximumNumberOfWorkers - Maximum number of workers that this pool should manage. */ public constructor ( protected readonly minimumNumberOfWorkers: number, @@ -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') } }