chore: generate documentation
[poolifier.git] / src / pools / cluster / dynamic.ts
index 513a73c5d7804cfa2e109a5d9cf6c01f4c060945..c4fc788cd8dcdd0528bca2234caead2d9fc70ccd 100644 (file)
@@ -1,4 +1,3 @@
-import { EMPTY_OBJECT_LITERAL } from '../../utils'
 import { PoolType } from '../pool-internal'
 import type { ClusterPoolOptions } from './fixed'
 import { FixedClusterPool } from './fixed'
@@ -28,9 +27,9 @@ export class DynamicClusterPool<
    */
   public constructor (
     min: number,
-    protected readonly max: number,
+    private readonly max: number,
     filePath: string,
-    opts: ClusterPoolOptions = EMPTY_OBJECT_LITERAL
+    opts: ClusterPoolOptions = {}
   ) {
     super(min, filePath, opts)
   }
@@ -41,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
+  }
 }