## Node versions
-Node versions >= 16.x are supported.
+Node versions >= 16.14.x are supported.
## [API](https://poolifier.github.io/poolifier/)
- `workerChoiceStrategyOptions` (optional) - The worker choice strategy options object to use in this pool.
Properties:
- - `medRunTime` (optional) - Use the tasks median run time instead of the tasks average run time in worker choice strategies.
+ - `medRunTime` (optional) - Use the tasks median runtime instead of the tasks average runtime in worker choice strategies.
- `weights` (optional) - The worker weights to use in the weighted round robin worker choice strategy: `{ 0: 200, 1: 300, ..., n: 100 }`
Default: `{ medRunTime: false }`
"main": "index.js",
"author": "pioardi",
"engines": {
- "node": ">=14.14.0",
+ "node": ">=16.14.0",
"pnpm": ">=8.6.0"
},
"volta": {
]
},
"engines": {
- "node": ">=16.0.0",
+ "node": ">=16.14.0",
"pnpm": ">=8.6.0"
},
"volta": {
-import EventEmitter from 'node:events'
+import EventEmitterAsyncResource from 'node:events'
import type {
ErrorHandler,
ExitHandler,
/**
* Pool events emitter.
*/
-export class PoolEmitter extends EventEmitter {}
+export class PoolEmitter extends EventEmitterAsyncResource {}
/**
* Enumeration of pool events.
}
/**
- * Gets the worker task run time.
- * If the required statistics are `avgRunTime`, the average run time is returned.
- * If the required statistics are `medRunTime`, the median run time is returned.
+ * Gets the worker task runtime.
+ * If the required statistics are `avgRunTime`, the average runtime is returned.
+ * If the required statistics are `medRunTime`, the median runtime is returned.
*
* @param workerNodeKey - The worker node key.
- * @returns The worker task run time.
+ * @returns The worker task runtime.
*/
protected getWorkerTaskRunTime (workerNodeKey: number): number {
return this.requiredStatistics.medRunTime
*/
export interface WorkerChoiceStrategyOptions {
/**
- * Use tasks median run time instead of average run time.
+ * Use tasks median runtime instead of average runtime.
*
* @defaultValue false
*/
)
})
- it('Verify that worker choice strategy options enable median run time pool statistics', () => {
+ it('Verify that worker choice strategy options enable median runtime pool statistics', () => {
const wwrWorkerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool,