docs: enhance documentation
[poolifier.git] / src / pools / selection-strategies / worker-choice-strategy-context.ts
index e763f7b2709c083afc81f7c7e53c074e9c59e7a8..91441ace5a58d8ca6756a21b679a3dd13b73df55 100644 (file)
@@ -1,4 +1,5 @@
-import type { IPoolInternal } from '../pool-internal'
+import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import type { IPool } from '../pool'
 import type { IWorker } from '../worker'
 import { FairShareWorkerChoiceStrategy } from './fair-share-worker-choice-strategy'
 import { LessBusyWorkerChoiceStrategy } from './less-busy-worker-choice-strategy'
@@ -18,7 +19,7 @@ import { WeightedRoundRobinWorkerChoiceStrategy } from './weighted-round-robin-w
  *
  * @typeParam Worker - Type of worker.
  * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
- * @typeParam Response - Type of response of execution. This can only be serializable data.
+ * @typeParam Response - Type of execution response. This can only be serializable data.
  */
 export class WorkerChoiceStrategyContext<
   Worker extends IWorker,
@@ -38,9 +39,9 @@ export class WorkerChoiceStrategyContext<
    * @param opts - The worker choice strategy options.
    */
   public constructor (
-    pool: IPoolInternal<Worker, Data, Response>,
+    pool: IPool<Worker, Data, Response>,
     private workerChoiceStrategyType: WorkerChoiceStrategy = WorkerChoiceStrategies.ROUND_ROBIN,
-    opts: WorkerChoiceStrategyOptions = { medRunTime: false }
+    opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
   ) {
     this.execute.bind(this)
     this.workerChoiceStrategies = new Map<