"FOSS",
"Gitter",
"inheritDoc",
- "IWWR",
+ "IWRR",
"jaywcjlove",
"lcov",
"libuv",
### Fixed
-- Ensure pool statuses are checked at initialization, `start()` or `destroy()`
+- 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
### `pool.execute(data, name, transferList)`
-`data` (optional) An object that you want to pass to your worker implementation.
+`data` (optional) An object that you want to pass to your worker task function implementation.
`name` (optional) A string with the task function name that you want to execute on the worker. Default: `'default'`
`transferList` (optional) An array of transferable objects that you want to transfer to your [worker_threads](https://nodejs.org/api/worker_threads.html) worker implementation.
### Interleaved weighted round robin (experimental)
-The worker weights are maximum tasks execution time. The rounds are the deduplicated worker weights.
+The worker weights are maximum tasks execution time. The rounds are the deduplicated worker weights in descending 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) => a - b)
+ .sort((a, b) => b - a)
)
]
}