-import type { IPoolInternal } from '../pool-internal'
-import { PoolType } from '../pool-internal'
-import type { IPoolWorker } from '../pool-worker'
+import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import { PoolType, type IPool } from '../pool'
+import type { IWorker } from '../worker'
*
* @typeParam Worker - Type of worker which manages the strategy.
* @typeParam Data - Type of data sent to the worker. This can only be serializable data.
*
* @typeParam Worker - Type of worker which manages the strategy.
* @typeParam Data - Type of data sent to the worker. This can only be serializable data.
- Worker extends IPoolWorker,
- Data,
- Response
-> implements IWorkerChoiceStrategy<Worker> {
- /** {@inheritDoc} */
- public readonly isDynamicPool: boolean
- /** {@inheritDoc} */
- public requiredStatistics: RequiredStatistics = {
- runTime: false
+ Worker extends IWorker,
+ Data = unknown,
+ Response = unknown
+> implements IWorkerChoiceStrategy {
+ /** @inheritDoc */
+ protected readonly isDynamicPool: boolean
+ /** @inheritDoc */
+ public readonly requiredStatistics: RequiredStatistics = {
+ runTime: false,
+ avgRunTime: false,
+ medRunTime: false
- protected readonly pool: IPoolInternal<Worker, Data, Response>
+ protected readonly pool: IPool<Worker, Data, Response>,
+ protected readonly opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS