- constructor(workerScript: string, min: number, max: number, workerStartDelay?: number, opts?: PoolOptions<Worker>) {
- super(workerScript, workerStartDelay);
- this.pool = DynamicPool.getInstance(min, max, this.workerScript, opts);
+ constructor(workerScript: string, workerOptions: WorkerOptions) {
+ super(workerScript, workerOptions);
+ this.pool = new DynamicThreadPool<WorkerData>(
+ this.workerOptions.poolMinSize,
+ this.workerOptions.poolMaxSize,
+ this.workerScript,
+ this.workerOptions.poolOptions,
+ );