X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=6067d62e3f645e358d276af007ae25e70e63980f;hb=c7e196baa67e4deb14377afbd9d6d5f655e5c384;hp=718b9db67c9e3455f36c366464ac1a8418dd1131;hpb=3bd6a82e43e11294af91bbd19647944ac740169e;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 718b9db6..6067d62e 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -24,9 +24,9 @@ When the maximum number of workers is reached and workers are busy, an event is
2.0.0
-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.
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
Overrides FixedClusterPool.busy
Protected
fullOverrides FixedClusterPool.full
Private
numberInherited from FixedClusterPool.numberOfQueuedTasks
Private
numberInherited 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.
@@ -287,17 +286,17 @@ 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.
Inherited from FixedClusterPool.afterWorkerSetup
Protected
beforeHook executed before the worker task execution. Can be overridden.
@@ -331,60 +330,58 @@ Can be overridden.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].
[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.
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
destroyShutdowns the given worker.
Inherited from FixedClusterPool.destroyWorker
Enables/disables the worker tasks queue in this pool.
Whether to enable or disable the worker tasks queue.
Optional
tasksQueueOptions: TasksQueueOptionsOptional
tasksQueueOptions: TasksQueueOptionsThe worker tasks queue options.
Inherited from FixedClusterPool.enableTasksQueue
Executes the function specified in the worker constructor with the task data input parameter.
- -Promise that will be fulfilled when the task is completed.
Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
Promise that will be fulfilled when the task is completed.
+Inherited from FixedClusterPool.execute
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.
A worker node key if there is one, -1
otherwise.
Inherited from FixedClusterPool.findFreeWorkerNodeKey
-Protected
internalInherited from FixedClusterPool.internalBusy
Protected
isShould return whether the worker is the main worker or not.
Inherited from FixedClusterPool.isMain
Protected
registerRegisters a listener callback on the given worker.
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: WorkerChoiceStrategyOptionsOptional
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
@@ -605,35 +586,33 @@ 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.
The listener function to execute when a message is received from a worker.
+This function is the listener registered for each worker message.
- -The listener function to execute when a message is received from a worker.
The listener function to execute when a message is received from a worker.
+Inherited from FixedClusterPool.workerListener
Type of data sent to the worker. This can only be serializable data.
@@ -38,11 +38,11 @@ When the maximum number of workers is reached and workers are busy, an event isHierarchy
-- FixedClusterPool<Data, Response>
+
- FixedClusterPool<Data, Response>
- DynamicClusterPool
@@ -83,7 +83,6 @@ When the maximum number of workers is reached and workers are busy, an event is destroy Worker
enable Tasks Queue
execute
-find Free Worker Node Key
internal Busy
is Main
register Worker Message Listener
@@ -99,13 +98,13 @@ When the maximum number of workers is reached and workers are busy, an event is
constructor
-- new
Dynamic Cluster Pool<Data, Response>(min, max, filePath, opts?): DynamicClusterPool<Data, Response>
+- new
Dynamic Cluster Pool<Data, Response>(min, max, filePath, opts?): DynamicClusterPool<Data, Response>
-
-
+
Constructs a new poolifier dynamic cluster pool.
Type Parameters
-+-
-
@@ -126,18 +125,18 @@ When the maximum number of workers is reached and workers are busy, an event is
-
-
Data = unknown
Path to an implementation of a
ClusterWorker
file, which can be relative or absolute.opts: ClusterPoolOptions = {}
+opts: ClusterPoolOptions = {}
Options for this dynamic cluster pool.