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

Selects the next worker with a weighted round robin scheduling algorithm. Loosely modeled after the weighted round robin queueing algorithm: https://en.wikipedia.org/wiki/Weighted_round_robin.

Constructors

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

Type Parameters

Worker extends IWorker
optional
Data = unknown
optional
Response = unknown

Properties

private
workerNodeVirtualTaskRunTime: number

Worker node virtual task runtime.

readonly
taskStatisticsRequirements: TaskStatisticsRequirements

Methods

private
weightedRoundRobinNextWorkerNodeKey(): number | undefined
choose(): number | undefined
remove(workerNodeKey: number): boolean
reset(): boolean
update(): boolean