docs: enhance error message
[poolifier.git] / src / pools / thread / dynamic.ts
index 62ddba9fc4792148a47f69c51c8c6f7a01b3adb0..05b61684173af58c7ed7dbbc52218c874a35fa7a 100644 (file)
@@ -28,7 +28,7 @@ export class DynamicThreadPool<
    */
   public constructor (
     min: number,
-    private readonly max: number,
+    public readonly max: number,
     filePath: string,
     opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
   ) {
@@ -42,11 +42,11 @@ export class DynamicThreadPool<
 
   /** @inheritDoc */
   public get full (): boolean {
-    return this.workers.length === this.max
+    return this.workerNodes.length === this.max
   }
 
   /** @inheritDoc */
   public get busy (): boolean {
-    return this.full && this.findFreeWorkerKey() === -1
+    return this.full && this.internalBusy()
   }
 }