X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Fdynamic.ts;h=c4fc788cd8dcdd0528bca2234caead2d9fc70ccd;hb=c2ade475e1b3b24aa2a1757b6d97a26063ec708c;hp=8b8c5185772dbea59bc0d22b2e1cb90b9383d507;hpb=ed6dd37f9e137cf659523d9d792f0171eedcb8ed;p=poolifier.git diff --git a/src/pools/cluster/dynamic.ts b/src/pools/cluster/dynamic.ts index 8b8c5185..c4fc788c 100644 --- a/src/pools/cluster/dynamic.ts +++ b/src/pools/cluster/dynamic.ts @@ -27,7 +27,7 @@ export class DynamicClusterPool< */ public constructor ( min: number, - protected readonly max: number, + private readonly max: number, filePath: string, opts: ClusterPoolOptions = {} ) { @@ -40,7 +40,12 @@ export class DynamicClusterPool< } /** {@inheritDoc} */ - public get busy (): boolean { + public get full (): boolean { return this.workers.length === this.max } + + /** {@inheritDoc} */ + public get busy (): boolean { + return this.full && this.findFreeWorkerKey() === -1 + } }