X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fselection-strategies-types.ts;h=0e549cec338b685d36e80ab1ff3d147ef6a3f83f;hb=08f3f44cef6256fdbab1a2a56842b291fd6dcd42;hp=065b310fa5e8a3454f84d5b0edd6324c7c2d0520;hpb=1d6ec394e8f7467f72baeb74dda4794fdc5ab322;p=poolifier.git diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 065b310f..0e549cec 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -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 } /** @@ -81,4 +90,10 @@ export interface IWorkerChoiceStrategy { * @param workerNodeKey - The worker node key. */ remove: (workerNodeKey: number) => boolean + /** + * Sets the worker choice strategy options. + * + * @param opts - The worker choice strategy options. + */ + setOptions: (opts: WorkerChoiceStrategyOptions) => void }