feat: add custom worker weights to worker choice strategies options
[poolifier.git] / src / pools / selection-strategies / selection-strategies-types.ts
index f9a504351a4bbbe9d33bddc145c457a7ce27ef78..0e549cec338b685d36e80ab1ff3d147ef6a3f83f 100644 (file)
@@ -35,8 +35,17 @@ export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
 export interface WorkerChoiceStrategyOptions {
   /**
    * Use tasks median run time instead of average run time.
+   *
+   * @defaultValue false
    */
   medRunTime?: boolean
+  /**
+   * Worker weights to use for weighted round robin worker selection strategy.
+   * Weight is the tasks maximum average or median runtime in milliseconds.
+   *
+   * @defaultValue Computed worker weights automatically given the CPU performance.
+   */
+  weights?: Record<number, number>
 }
 
 /**