import { WorkerChoiceStrategyContext } from "https://deno.land/x/poolifier@v0.3.14/src/pools/selection-strategies/worker-choice-strategy-context.ts";
The worker choice strategy context.
Constructors
new
WorkerChoiceStrategyContext(workerChoiceStrategy?: WorkerChoiceStrategy,
opts?: WorkerChoiceStrategyOptions,
Worker choice strategy context constructor.
Properties
private
readonly
workerChoiceStrategies: Map<WorkerChoiceStrategy, IWorkerChoiceStrategy>The worker choice strategy instances registered in the context.
Methods
private
executeStrategy(workerChoiceStrategy: IWorkerChoiceStrategy): numberExecutes the given worker choice strategy.
execute(): number
Executes the worker choice strategy in the context algorithm.
Gets the strategy policy in the context.
Gets the worker choice strategy in the context task statistics requirements.
remove(workerNodeKey: number): boolean
Removes the worker node key from the worker choice strategy in the context.
setOptions(opts: WorkerChoiceStrategyOptions | undefined): void
Sets the worker choice strategies in the context options.
setWorkerChoiceStrategy(workerChoiceStrategy: WorkerChoiceStrategy): void
Sets the worker choice strategy to use in the context.
update(workerNodeKey: number): boolean
Updates the worker node key in the worker choice strategy in the context internals.