fix: fix dynamic pool busy semantic
[poolifier.git] / src / pools / abstract-pool.ts
index f904af93183840b89edbf166dd02a61fa7e7ec1d..1e61071c42382e1ccb9d546cb0a035ac6196afe3 100644 (file)
@@ -143,8 +143,10 @@ export abstract class AbstractPool<
   /** {@inheritDoc} */
   public abstract get type (): PoolType
 
-  /** {@inheritDoc} */
-  public get numberOfRunningTasks (): number {
+  /**
+   * Number of tasks concurrently running.
+   */
+  private get numberOfRunningTasks (): number {
     return this.promiseResponseMap.size
   }
 
@@ -177,10 +179,13 @@ export abstract class AbstractPool<
     )
   }
 
+  /** {@inheritDoc} */
+  public abstract get full (): boolean
+
   /** {@inheritDoc} */
   public abstract get busy (): boolean
 
-  protected internalGetBusyStatus (): boolean {
+  protected internalBusy (): boolean {
     return (
       this.numberOfRunningTasks >= this.numberOfWorkers &&
       this.findFreeWorkerKey() === -1