X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fabstract-pool.ts;h=76dca07a8cf676a79f27c81096c6c9ead8ab910d;hb=a1b4a65143c0253b57fee18affd88a554122e955;hp=3b79565e062aa7b1660e42eb506478ca07d79da4;hpb=27469db4f589429f5dd309187b1de2aae0275cb0;p=poolifier.git diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 3b79565e..76dca07a 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -588,7 +588,8 @@ export abstract class AbstractPool< } /** - * The pool readiness boolean status. + * Whether the pool is ready or not. + * @returns The pool readiness boolean status. */ private get ready (): boolean { if (this.empty) { @@ -606,7 +607,8 @@ export abstract class AbstractPool< } /** - * The pool emptiness boolean status. + * Whether the pool is empty or not. + * @returns The pool emptiness boolean status. */ protected get empty (): boolean { return this.minimumNumberOfWorkers === 0 && this.workerNodes.length === 0 @@ -820,8 +822,7 @@ export abstract class AbstractPool< /** * Whether the pool is full or not. - * - * The pool filling boolean status. + * @returns The pool fullness boolean status. */ protected get full (): boolean { return ( @@ -832,8 +833,7 @@ export abstract class AbstractPool< /** * Whether the pool is busy or not. - * - * The pool busyness boolean status. + * @returns The pool busyness boolean status. */ protected abstract get busy (): boolean @@ -1132,7 +1132,7 @@ export abstract class AbstractPool< ) .filter( (strategy: WorkerChoiceStrategy | undefined) => strategy != null - ) as WorkerChoiceStrategy[]), + )), ]) } @@ -1225,7 +1225,6 @@ export abstract class AbstractPool< }) } - /** @inheritDoc */ public mapExecute ( data: Iterable, @@ -1252,6 +1251,9 @@ export abstract class AbstractPool< * @param initWorkerNodeUsage - Whether to initialize the worker node usage or not. @defaultValue false */ private startMinimumNumberOfWorkers (initWorkerNodeUsage = false): void { + if (this.minimumNumberOfWorkers === 0) { + return + } this.startingMinimumNumberOfWorkers = true while ( this.workerNodes.reduce(