MessageValue,
PromiseWorkerResponseWrapper
} from '../utility-types'
+import { EMPTY_FUNCTION } from '../utils'
import { isKillBehavior, KillBehaviors } from '../worker/worker-options'
import type { IPoolInternal } from './pool-internal'
import { PoolEmitter, PoolType } from './pool-internal'
WorkerChoiceStrategyContext
} from './selection-strategies'
-/**
- * An intentional empty function.
- */
-const EMPTY_FUNCTION: () => void = () => {
- /* Intentionally empty */
-}
-
/**
* Callback invoked if the worker raised an error.
*/
})
return workerCreated
},
- opts.workerChoiceStrategy ?? WorkerChoiceStrategies.ROUND_ROBIN
+ this.opts.workerChoiceStrategy
)
}
}
private checkPoolOptions (opts: PoolOptions<Worker>): void {
+ this.opts.workerChoiceStrategy =
+ opts.workerChoiceStrategy ?? WorkerChoiceStrategies.ROUND_ROBIN
this.opts.enableEvents = opts.enableEvents ?? true
}