X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FWorkerChoiceStrategyContext.html;h=bfa141d3cce163e5c7881e082c88d4ba055f374d;hb=4baa5f634e5cd68c9447999c1ab84a3ef6f7583d;hp=78ca4d6547318d39fb68daf20067cf8fda18a19b;hpb=cda623c57bf49a82b898aadf180a68130df34507;p=poolifier.git diff --git a/docs/classes/WorkerChoiceStrategyContext.html b/docs/classes/WorkerChoiceStrategyContext.html index 78ca4d65..bfa141d3 100644 --- a/docs/classes/WorkerChoiceStrategyContext.html +++ b/docs/classes/WorkerChoiceStrategyContext.html @@ -1,12 +1,13 @@ -
The worker choice strategy context.
+- Preparing search index...
- The search index is not available
poolifier - v3.1.8Class WorkerChoiceStrategyContext<Worker, Data, Response>
The worker choice strategy context.
Type Parameters
Worker extends IWorker
Type of worker.
Data = unknown
Type of data sent to the worker. This can only be structured-cloneable data.
Response = unknown
Type of execution response. This can only be structured-cloneable data.
-Index
Constructors
Properties
Index
Constructors
Properties
Methods
Constructors
constructor
Worker choice strategy context constructor.
Type Parameters
Worker extends IWorker
Data = unknown
Response = unknown
Parameters
pool: IPool<Worker, Data, Response>
The pool instance.
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN" = WorkerChoiceStrategies.ROUND_ROBIN
The worker choice strategy.
-opts: WorkerChoiceStrategyOptions = DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
The worker choice strategy options.
-Returns WorkerChoiceStrategyContext<Worker, Data, Response>
Properties
Private
optsThe worker choice strategy options.
-Private
Readonly
workerPrivate
workerThe worker choice strategy.
-Methods
execute
Executes the worker choice strategy in the context algorithm.
+Optional
opts: InternalWorkerChoiceStrategyOptionsThe worker choice strategy options.
+Returns WorkerChoiceStrategyContext<Worker, Data, Response>
Properties
Private
Optional
optsThe worker choice strategy options.
+Private
Readonly
workerPrivate
workerThe worker choice strategy.
+Methods
execute
Executes the worker choice strategy in the context algorithm.
Returns number
The key of the worker node.
Throws
https://nodejs.org/api/errors.html#class-error If after configured retries the worker node key is null or undefined.
-Throws
https://nodejs.org/api/errors.html#class-error If the maximum consecutive worker choice strategy executions has been reached.
-get Strategy Policy
Gets the strategy policy in the context.
+Private
executeExecutes the given worker choice strategy.
+Parameters
workerChoiceStrategy: IWorkerChoiceStrategy
The worker choice strategy.
+Returns number
The key of the worker node.
+Throws
https://nodejs.org/api/errors.html#class-error If after configured retries the worker node key is null or undefined.
+get Strategy Policy
Gets the strategy policy in the context.
Returns StrategyPolicy
The strategy policy.
-get Task Statistics Requirements
Gets the worker choice strategy in the context task statistics requirements.
+get Task Statistics Requirements
Gets the worker choice strategy in the context task statistics requirements.
Returns TaskStatisticsRequirements
The task statistics requirements.
-remove
Removes the worker node key from the worker choice strategy in the context.
+remove
Removes the worker node key from the worker choice strategy in the context.
Parameters
workerNodeKey: number
The worker node key.
Returns boolean
-true
if the removal is successful,false
otherwise.set Options
Sets the worker choice strategies in the context options.
-Parameters
opts: WorkerChoiceStrategyOptions
The worker choice strategy options.
-Returns void
set Worker Choice Strategy
Sets the worker choice strategy to use in the context.
+set Options
Sets the worker choice strategies in the context options.
+Parameters
pool: IPool<Worker, Data, Response>
The pool instance.
+Optional
opts: InternalWorkerChoiceStrategyOptionsThe worker choice strategy options.
+Returns void
set Worker Choice Strategy
Sets the worker choice strategy to use in the context.
Parameters
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
The worker choice strategy to set.
-Returns void
update
Updates the worker node key in the worker choice strategy in the context internals.
+Returns void
update
Updates the worker node key in the worker choice strategy in the context internals.
Parameters
workerNodeKey: number
Returns boolean
-true
if the update is successful,false
otherwise.Settings
Member Visibility
Theme
On This Page
Generated using TypeDoc
Settings
Member Visibility
Theme
On This Page
Generated using TypeDoc