refactor: move worker setup into worker node constructor
[poolifier.git] / src / pools / cluster / dynamic.ts
index 99a89966e914507fa6868883a0f67c751c8b29c6..32aad22a738c8541a4147ebbad7a3048ff51f8af 100644 (file)
@@ -1,6 +1,7 @@
-import { type PoolType, PoolTypes } from '../pool'
+import { type Worker } from 'node:cluster'
+import { type PoolOptions, type PoolType, PoolTypes } from '../pool'
 import { checkDynamicPoolSize } from '../utils'
-import { type ClusterPoolOptions, FixedClusterPool } from './fixed'
+import { FixedClusterPool } from './fixed'
 
 /**
  * A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
@@ -29,7 +30,7 @@ export class DynamicClusterPool<
     min: number,
     protected readonly max: number,
     filePath: string,
-    opts: ClusterPoolOptions = {}
+    opts: PoolOptions<Worker> = {}
   ) {
     super(min, filePath, opts)
     checkDynamicPoolSize(this.numberOfWorkers, this.max)