X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=a0c6b16f6ed7b5a16e38c30c75c62302cd54b9c7;hb=f8350486e75b15ed17249cda3d0a55ee807a6a9f;hp=ed4f6fed2826078bfdeac466bcec7e8c4c80bef5;hpb=56960396878dec81e3ebeea5b76387efca8cc2dc;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index ed4f6fed..a0c6b16f 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -2,8 +2,7 @@ import type { ClusterSettings, Worker } from 'node:cluster' import cluster from 'node:cluster' import type { MessageValue } from '../../utility-types' import { AbstractPool } from '../abstract-pool' -import type { PoolOptions } from '../pool' -import { PoolType } from '../pool' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool' /** * Options for a poolifier cluster pool. @@ -97,12 +96,22 @@ export class FixedClusterPool< /** @inheritDoc */ public get type (): PoolType { - return PoolType.FIXED + return PoolTypes.fixed + } + + /** @inheritDoc */ + protected get minSize (): number { + return this.numberOfWorkers + } + + /** @inheritDoc */ + protected get maxSize (): number { + return this.numberOfWorkers } /** @inheritDoc */ protected get full (): boolean { - return this.workerNodes.length === this.numberOfWorkers + return this.workerNodes.length >= this.numberOfWorkers } /** @inheritDoc */