Type of worker.
Type of data sent to the worker. This can only be structured-cloneable data.
Type of execution response. This can only be structured-cloneable data.
Worker choice strategies context constructor.
The pool instance.
The worker choice strategies.
Optional
opts: WorkerChoiceStrategyOptionsThe worker choice strategy options.
[WorkerChoiceStrategies.ROUND_ROBIN]
Private
defaultThe default worker choice strategy in the context.
Private
Readonly
poolThe pool instance.
Private
Readonly
retriesThe maximum number of worker choice strategies execution retries.
The number of worker choice strategies execution retries.
Private
Readonly
workerThe worker choice strategies registered in the context.
Private
workerThe active worker choice strategies in the context policy.
Private
workerThe active worker choice strategies in the context task statistics requirements.
Private
addAdds a worker choice strategy to the context.
The worker choice strategy to add.
Optional
opts: WorkerChoiceStrategyOptionsThe worker choice strategy options.
The worker choice strategies.
Executes the given worker choice strategy in the context algorithm.
The worker choice strategy algorithm to execute.
The key of the worker node.
this.defaultWorkerChoiceStrategy
https://nodejs.org/api/errors.html#class-error If after computed retries the worker node key is null or undefined.
Private
executeExecutes the given worker choice strategy.
The worker choice strategy.
The key of the worker node.
https://nodejs.org/api/errors.html#class-error If after computed retries the worker node key is null or undefined.
Gets the active worker choice strategies in the context policy.
The strategies policy.
Gets the active worker choice strategies in the context task statistics requirements.
The strategies task statistics requirements.
Private
removeRemoves a worker choice strategy from the context.
The worker choice strategy to remove.
true
if the worker choice strategy is removed, false
otherwise.
Sets the default worker choice strategy to use in the context.
The default worker choice strategy to set.
Optional
opts: WorkerChoiceStrategyOptionsThe worker choice strategy options.
Sets the active worker choice strategies in the context options.
The worker choice strategy options.
Synchronizes the active worker choice strategies in the context with the given worker choice strategies.
The worker choice strategies to synchronize.
Optional
opts: WorkerChoiceStrategyOptionsThe worker choice strategy options.
The worker choice strategies context.