X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FDynamicClusterPool.html;h=53242a4961ac606d00edf78b736aea361a0beb91;hb=938d9c678aa8e70e5642feffb90604cf25c993fe;hp=0386e65b205229b799bc4793b2b3dddfe5c7d8bb;hpb=aec509b85e7d73e9883c8885e27fc4e34fdaef1e;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 0386e65b..53242a49 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,4 +1,4 @@ -
Type of response of execution. This can only be serializable data.
+Type of execution response. This can only be serializable data.
Constructs a new poolifier dynamic cluster pool.
Minimum number of workers which are always active.
Maximum number of workers that can be created by this pool.
Path to an implementation of a ClusterWorker
file, which can be relative or absolute.
Options for this dynamic cluster pool.
Optional
Readonly
emitterEmitter on which events can be listened to.
Events that can currently be listened to:
Inherited from FixedClusterPool.emitter
Readonly
filePath to the worker-file.
+Path to the worker file.
Inherited from FixedClusterPool.filePath
Readonly
maxMaximum number of workers that can be created by this pool.
Readonly
numberNumber of workers that this pool should manage.
Inherited from FixedClusterPool.numberOfWorkers
Readonly
optsOptions for this fixed cluster pool.
Inherited from FixedClusterPool.opts
Protected
promiseThe execution response promise map.
key
: The message id of each submitted task.Inherited from FixedClusterPool.promiseResponseMap
Protected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
Default to a round robin algorithm.
Inherited from FixedClusterPool.workerChoiceStrategyContext
Readonly
workerPool worker nodes.
Inherited from FixedClusterPool.workerNodes
Protected
busyWhether the pool is busy or not.
@@ -219,10 +221,10 @@ When the maximum number of workers is reached and workers are busy, an event isOverrides FixedClusterPool.busy
Protected
fullWhether the pool is full or not.
@@ -231,10 +233,10 @@ When the maximum number of workers is reached and workers are busy, an event isOverrides FixedClusterPool.full
Private
numberNumber of tasks queued in the pool.
@@ -242,10 +244,10 @@ When the maximum number of workers is reached and workers are busy, an event isInherited from FixedClusterPool.numberOfQueuedTasks
Private
numberNumber of tasks running in the pool.
@@ -253,25 +255,25 @@ When the maximum number of workers is reached and workers are busy, an event isInherited from FixedClusterPool.numberOfRunningTasks
Pool type.
If it is 'dynamic'
, it provides the max
property.
Overrides FixedClusterPool.type
Protected
afterHook executed after the worker task execution. Can be overridden.
@@ -280,21 +282,21 @@ Can be overridden.The worker.
The received message.
Inherited from FixedClusterPool.afterTaskExecutionHook
Protected
afterFunction that can be hooked up when a worker has been newly created and moved to the pool worker nodes.
Can be used to update the maxListeners
or binding the main-worker
<->worker
connection if not bind by default.
The newly created worker.
Inherited from FixedClusterPool.afterWorkerSetup
Protected
beforeHook executed before the worker task execution. Can be overridden.
@@ -322,66 +324,66 @@ Can be overridden.The worker node key.
Inherited from FixedClusterPool.beforeTaskExecutionHook
Protected
chooseChooses a worker node for the next task.
The default uses a round robin algorithm to distribute the load.
[worker node key, worker node].
Inherited from FixedClusterPool.chooseWorkerNode
Protected
createCreates a new worker and sets it up completely in the pool worker nodes.
New, completely set up worker.
Inherited from FixedClusterPool.createAndSetupWorker
Protected
createReturns a newly created worker.
Inherited from FixedClusterPool.createWorker
Shutdowns every current worker in this pool.
Inherited from FixedClusterPool.destroy
Protected
destroyInherited from FixedClusterPool.destroyWorker
Performs the task specified in the constructor with the data parameter.
- -Promise that will be resolved when the task is successfully completed.
+Enables/disables the worker tasks queue in this pool.
The input for the specified task. This can only be serializable data.
+Whether to enable or disable the worker tasks queue.
+Optional
tasksQueueOptions: TasksQueueOptionsThe worker tasks queue options.
Inherited from FixedClusterPool.execute
+Inherited from FixedClusterPool.enableTasksQueue
Finds a free worker node key based on the number of tasks the worker has applied.
-If a worker is found with 0
running tasks, it is detected as free and its worker node key is returned.
If no free worker is found, -1
is returned.
Executes the function specified in the worker constructor with the task data input parameter.
-A worker node key if there is one, -1
otherwise.
Promise that will be fulfilled when the task is completed.
Inherited from FixedClusterPool.findFreeWorkerNodeKey
+Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
+Inherited from FixedClusterPool.execute
Protected
internalInherited from FixedClusterPool.internalBusy
Protected
isShould return whether the worker is the main worker or not.
Inherited from FixedClusterPool.isMain
Protected
registerThe worker which should register a listener.
The message listener callback.
Inherited from FixedClusterPool.registerWorkerMessageListener
Protected
sendSends a message to the given worker.
The worker which should receive the message.
The message.
Inherited from FixedClusterPool.sendToWorker
Sets the worker tasks queue options in this pool.
+The worker tasks queue options.
+Inherited from FixedClusterPool.setTasksQueueOptions
+Sets the worker choice strategy in this pool.
The worker choice strategy.
+Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsThe worker choice strategy options.
Inherited from FixedClusterPool.setWorkerChoiceStrategy
Sets the worker choice strategy options in this pool.
+The worker choice strategy options.
+Inherited from FixedClusterPool.setWorkerChoiceStrategyOptions
+Protected
setupSetup hook to execute code before worker node are created in the abstract constructor. Can be overridden
@@ -540,21 +589,21 @@ Can be overriddenInherited from FixedClusterPool.setupHook
Protected
workerThis function is the listener registered for each worker message.
The listener function to execute when a message is received from a worker.
This function is the listener registered for each worker message.
@@ -564,11 +613,11 @@ Can be overriddenInherited from FixedClusterPool.workerListener
Generated using TypeDoc
Type of data sent to the worker. This can only be serializable data.