X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fselection-strategies%2Fselection-strategies-types.ts;h=ddfe915d2e3c215f9365693c81754155c2c10bc5;hb=9e775f96c71628a400c029d69d28150defe4186c;hp=968d2996e0dfd05f7a21404c656010e2bdfcc92b;hpb=138d29a820e8a61d10ba03fe42c5d77596ef788c;p=poolifier.git diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 968d2996..ddfe915d 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -34,7 +34,7 @@ export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies */ export interface WorkerChoiceStrategyOptions { /** - * Use tasks median run time instead of average run time. + * Use tasks median runtime instead of average runtime. * * @defaultValue false */ @@ -55,15 +55,15 @@ export interface WorkerChoiceStrategyOptions { */ export interface RequiredStatistics { /** - * Require tasks run time. + * Require tasks runtime. */ runTime: boolean /** - * Require tasks average run time. + * Require tasks average runtime. */ avgRunTime: boolean /** - * Require tasks median run time. + * Require tasks median runtime. */ medRunTime: boolean } @@ -78,20 +78,24 @@ export interface IWorkerChoiceStrategy { readonly requiredStatistics: RequiredStatistics /** * Resets strategy internals. + * + * @returns `true` if the reset is successful, `false` otherwise. */ reset: () => boolean /** - * Updates strategy internals. + * Updates the worker node key strategy internals. * * @returns `true` if the update is successful, `false` otherwise. */ - update: () => boolean + update: (workerNodeKey: number) => boolean /** * Chooses a worker node in the pool and returns its key. + * + * @returns The worker node key. */ choose: () => number /** - * Removes a worker node key from strategy internals. + * Removes the worker node key from strategy internals. * * @param workerNodeKey - The worker node key. * @returns `true` if the worker node key is removed, `false` otherwise.