### Added
- Add `startWorkers` to pool options to whether start the minimum number of workers at pool creation or not.
-- Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable tasks stealing or not and whether enable tasks stealing on back pressure or not.
+- Add `taskStealing` and `tasksStealingOnPressure` to tasks queue options to whether enable task stealing or not and whether enable tasks stealing on back pressure or not.
- Continuous internal benchmarking: https://poolifier.github.io/benchmark-results/dev/bench.
## [2.6.44] - 2023-09-08
.on('cycle', event => {
console.info(event.target.toString())
})
- .on('complete', function () {
+ .on('complete', async function () {
console.info(
'Fastest is ' + LIST_FORMATTER.format(this.filter('fastest').map('name'))
)
- fixedThreadPool.destroy()
+ await fixedThreadPool.destroy()
})
.run({ async: true })
An object with these properties:
-- `onlineHandler` (optional) - A function that will listen for online event on each worker
-- `messageHandler` (optional) - A function that will listen for message event on each worker
-- `errorHandler` (optional) - A function that will listen for error event on each worker
-- `exitHandler` (optional) - A function that will listen for exit event on each worker
-- `startWorkers` (optional) - Start the minimum number of workers at pool creation.
- Default: `true`
+- `onlineHandler` (optional) - A function that will listen for online event on each worker.
+ Default: `() => {}`
+- `messageHandler` (optional) - A function that will listen for message event on each worker.
+ Default: `() => {}`
+- `errorHandler` (optional) - A function that will listen for error event on each worker.
+ Default: `() => {}`
+- `exitHandler` (optional) - A function that will listen for exit event on each worker.
+ Default: `() => {}`
+
- `workerChoiceStrategy` (optional) - The worker choice strategy to use in this pool:
- `WorkerChoiceStrategies.ROUND_ROBIN`: Submit tasks to worker in a round robin fashion
Default: `{ retries: 6, runTime: { median: false }, waitTime: { median: false }, elu: { median: false } }`
+- `startWorkers` (optional) - Start the minimum number of workers at pool creation.
+ Default: `true`
- `restartWorkerOnError` (optional) - Restart worker on uncaught error in this pool.
Default: `true`
- `enableEvents` (optional) - Events emission enablement in this pool.
- `size` (optional) - The maximum number of tasks that can be queued on a worker before flagging it as back pressured. It must be a positive integer.
- `concurrency` (optional) - The maximum number of tasks that can be executed concurrently on a worker. It must be a positive integer.
- - `taskStealing` (optional) - Tasks stealing enablement.
+ - `taskStealing` (optional) - Task stealing enablement.
- `tasksStealingOnBackPressure` (optional) - Tasks stealing enablement on back pressure.
Default: `{ size: (pool maximum size)^2, concurrency: 1, taskStealing: true, tasksStealingOnBackPressure: true }`