docs: enhance documentation
[poolifier.git] / src / pools / thread / dynamic.ts
index 33e42892c424a671caf547148aa4deacaf83f5f8..7bf477dd837c0ce3e30cb65ad308c32ca0774f48 100644 (file)
@@ -1,5 +1,5 @@
 import type { PoolOptions } from '../pool'
-import { PoolType } from '../pool-internal'
+import { PoolType } from '../pool'
 import type { ThreadWorkerWithMessageChannel } from './fixed'
 import { FixedThreadPool } from './fixed'
 
@@ -28,25 +28,25 @@ export class DynamicThreadPool<
    */
   public constructor (
     min: number,
-    private readonly max: number,
+    public readonly max: number,
     filePath: string,
     opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
   ) {
     super(min, filePath, opts)
   }
 
-  /** {@inheritDoc} */
+  /** @inheritDoc */
   public get type (): PoolType {
     return PoolType.DYNAMIC
   }
 
-  /** {@inheritDoc} */
-  public get full (): boolean {
-    return this.workers.length === this.max
+  /** @inheritDoc */
+  protected get full (): boolean {
+    return this.workerNodes.length === this.max
   }
 
-  /** {@inheritDoc} */
-  public get busy (): boolean {
-    return this.full && this.findFreeWorkerKey() === -1
+  /** @inheritDoc */
+  protected get busy (): boolean {
+    return this.full && this.internalBusy()
   }
 }