Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
class InterleavedWeightedRoundRobinWorkerChoiceStrategy
import { InterleavedWeightedRoundRobinWorkerChoiceStrategy } from "https://deno.land/x/poolifier@v0.3.14/src/pools/selection-strategies/interleaved-weighted-round-robin-worker-choice-strategy.ts";

Selects the next worker with an interleaved weighted round robin scheduling algorithm.

Constructors

new
InterleavedWeightedRoundRobinWorkerChoiceStrategy(pool: IPool<Worker, Data, Response>, opts?: WorkerChoiceStrategyOptions)

Type Parameters

Worker extends IWorker
optional
Data = unknown
optional
Response = unknown

Properties

private
roundId: number

Round id.

private
roundWeights: number[]

Round weights.

private
workerNodeId: number

Worker node id.

private
workerNodeVirtualTaskRunTime: number

Worker node virtual task runtime.

readonly
taskStatisticsRequirements: TaskStatisticsRequirements

Methods

private
getRoundWeights(): number[]
choose(): number | undefined
remove(workerNodeKey: number): boolean
reset(): boolean
setOptions(opts: WorkerChoiceStrategyOptions | undefined): void
update(): boolean