Pool busy event emitting on all pool types (#241)
[poolifier.git] / src / pools / cluster / dynamic.ts
index f0c3c0e40cf21cceb0e2048d1b7931417d972c96..33497b0314ef1e46eb3bd129557f31b5e5f4cc17 100644 (file)
@@ -1,3 +1,4 @@
+import { PoolType } from '../pool-internal'
 import type { ClusterPoolOptions } from './fixed'
 import { FixedClusterPool } from './fixed'
 
@@ -35,7 +36,12 @@ export class DynamicClusterPool<
   }
 
   /** @inheritdoc */
-  public get dynamic (): boolean {
-    return true
+  public get type (): PoolType {
+    return PoolType.DYNAMIC
+  }
+
+  /** @inheritdoc */
+  public get busy (): boolean {
+    return this.workers.length === this.max
   }
 }