Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
### Fixed
- Ensure pool statuses are checked at initialization, `start()` or `destroy()`.
-- Sort IWRR worker choice strategy round weights in descending order.
## [3.0.5] - 2023-10-27
### Interleaved weighted round robin (experimental)
-The worker weights are maximum tasks execution time. The rounds are the deduplicated worker weights in descending order.
+The worker weights are maximum tasks execution time. The rounds are the deduplicated worker weights in ascending order.
During a round, if the worker weight is superior or equal to the current round weight and its tasks execution time is inferior to the current round weight, the task is assigned to the worker. Once all workers weight have been tested, the next round starts.
The default worker weights is the same for each and computed given the CPU cores speed and theirs numbers. So the default 'rounds' consists of a unique worker weight.
...new Set(
Object.values(this.opts.weights)
.slice()
- .sort((a, b) => b - a)
+ .sort((a, b) => a - b)
)
]
}