refactor: conditionally reset strategy internals
[poolifier.git] / src / pools / thread / fixed.ts
index 13a280b54723e2fcf18f2af5ce73322d4e4f8a11..2c4f66f0ff4d8be12d192f4028b1b1a17262bbc7 100644 (file)
@@ -1,4 +1,9 @@
-import { isMainThread, MessageChannel, SHARE_ENV, Worker } from 'worker_threads'
+import {
+  isMainThread,
+  MessageChannel,
+  SHARE_ENV,
+  Worker
+} from 'node:worker_threads'
 import type { Draft, MessageValue } from '../../utility-types'
 import { AbstractPool } from '../abstract-pool'
 import type { PoolOptions } from '../pool'
@@ -91,8 +96,13 @@ export class FixedThreadPool<
     return PoolType.FIXED
   }
 
+  /** {@inheritDoc} */
+  public get full (): boolean {
+    return this.workers.length === this.numberOfWorkers
+  }
+
   /** {@inheritDoc} */
   public get busy (): boolean {
-    return this.internalGetBusyStatus()
+    return this.internalBusy()
   }
 }