X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fselection-strategies-types.ts;h=4d302f3defb1e7d5619d37693daf4104c944f377;hb=2377984dc95d13e0a684210368e3e4d4ba6239d6;hp=edefcfaac429d8c0d24fa897300650d141ab7f3c;hpb=bdaf31cd0e637aa466c78d54a49f157899a2cb3f;p=poolifier.git diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index edefcfaa..4d302f3d 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -11,7 +11,15 @@ export const WorkerChoiceStrategies = Object.freeze({ /** * Less recently used worker selection strategy. */ - LESS_RECENTLY_USED: 'LESS_RECENTLY_USED' + LESS_RECENTLY_USED: 'LESS_RECENTLY_USED', + /** + * Fair share worker selection strategy. + */ + FAIR_SHARE: 'FAIR_SHARE', + /** + * Weighted round robin worker selection strategy. + */ + WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN' } as const) /** @@ -19,6 +27,13 @@ export const WorkerChoiceStrategies = Object.freeze({ */ export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies +/** + * Tasks usage statistics requirements. + */ +export type RequiredStatistics = { + runTime: boolean +} + /** * Worker choice strategy interface. * @@ -29,6 +44,10 @@ export interface IWorkerChoiceStrategy { * Is the pool attached to the strategy dynamic?. */ isDynamicPool: boolean + /** + * Required tasks usage statistics. + */ + requiredStatistics: RequiredStatistics /** * Choose a worker in the pool. */