refactor: cleanup variables namespace
[poolifier.git] / src / pools / thread / dynamic.ts
index 00d25c0a5fd8d1060a575b9995c4e189475f15a5..b6d41e9ef9f7ff92cecf89e068c6493bafe696e3 100644 (file)
@@ -1,5 +1,5 @@
-import { type PoolOptions, type PoolType, PoolTypes } from '../pool'
-import { FixedThreadPool, type ThreadWorkerWithMessageChannel } from './fixed'
+import { type PoolType, PoolTypes } from '../pool'
+import { FixedThreadPool, type ThreadPoolOptions } from './fixed'
 
 /**
  * A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.
@@ -26,23 +26,18 @@ export class DynamicThreadPool<
    */
   public constructor (
     min: number,
-    public readonly max: number,
+    protected readonly max: number,
     filePath: string,
-    opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
+    opts: ThreadPoolOptions = {}
   ) {
     super(min, filePath, opts)
   }
 
   /** @inheritDoc */
-  public get type (): PoolType {
+  protected get type (): PoolType {
     return PoolTypes.dynamic
   }
 
-  /** @inheritDoc */
-  protected get full (): boolean {
-    return this.workerNodes.length >= this.max
-  }
-
   /** @inheritDoc */
   protected get maxSize (): number {
     return this.max