X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=f6c8e28904ec40bcc83cea1f4b18c802ba2ebd2a;hb=a34454964733f585af19a04f21f9e35eb18c77b1;hp=051f7ce50d1267c4d8f903d1404441fa329dbba0;hpb=e83f3916315e18f3ca0c614d6ec9e064ab76c13c;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 051f7ce5..f6c8e289 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,11 +1,13 @@
Optional
Readonly
emitterReadonly
fileReadonly
maxInherited from FixedClusterPool.max
-Protected
nextId of the next message.
+Maximum number of workers that can be created by this pool.
Inherited from FixedClusterPool.nextMessageId
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 promise map.
+Protected
promiseThe promise response map.
key
: This is the message Id of each submitted task.value
: An object that contains the worker, the resolve function and the reject function.key
: The message id of each submitted task.value
: An object that contains the worker, the promise resolve and reject callbacks.When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.
+When we receive a message from the worker we get a map entry with the promise resolve/reject bound to the message.
Inherited from FixedClusterPool.promiseMap
+Inherited from FixedClusterPool.promiseResponseMap
Protected
workerWorker choice strategy instance implementing the worker choice algorithm.
-Default to a strategy implementing a round robin algorithm.
+Worker choice strategy context referencing a worker choice algorithm implementation.
+Default to a round robin algorithm.
Inherited from FixedClusterPool.workerChoiceStrategyContext
Readonly
workersReadonly
workerInherited from FixedClusterPool.workers
+Inherited from FixedClusterPool.workerNodes
Readonly
workersInherited from FixedClusterPool.workersTasksUsage
-Overrides FixedClusterPool.busy
Overrides FixedClusterPool.full
+Private
numberNumber of tasks queued in the pool.
+Inherited from FixedClusterPool.numberOfQueuedTasks
+Private
numberNumber of tasks running in the pool.
+Inherited from FixedClusterPool.numberOfRunningTasks
Overrides FixedClusterPool.type
Protected
afterProtected
afterHook executed after the worker task promise resolution. Can be overridden.
@@ -265,17 +278,17 @@ Can be overridden.The received message.
+The worker.
The Promise response.
+The received message.
Inherited from FixedClusterPool.afterPromiseWorkerResponseHook
+Inherited from FixedClusterPool.afterPromiseResponseHook
Protected
afterInherited from FixedClusterPool.afterWorkerSetup
Protected
beforeProtected
beforeHook executed before the worker task promise resolution. Can be overridden.
@@ -304,40 +317,40 @@ Can be overridden.The worker.
+The worker node key.
Inherited from FixedClusterPool.beforePromiseWorkerResponseHook
+Inherited from FixedClusterPool.beforePromiseResponseHook
Protected
chooseProtected
chooseChooses a worker for the next task.
-The default implementation uses a round robin algorithm to distribute the load.
+Chooses a worker node for the next task.
+The default uses a round robin algorithm to distribute the load.
-Worker.
+[worker node key, worker node].
Inherited from FixedClusterPool.chooseWorker
+Inherited from FixedClusterPool.chooseWorkerNode
Protected
createCreates a new worker for this pool and sets it up completely.
+Creates a new worker and sets it up completely in the pool worker nodes.
New, completely set up worker.
Inherited from FixedClusterPool.createAndSetupWorker
Protected
createInherited from FixedClusterPool.createWorker
Protected
dequeueInherited from FixedClusterPool.dequeueTask
+Inherited from FixedClusterPool.destroy
Inherited from FixedClusterPool.destroyWorker
Protected
enqueueInherited from FixedClusterPool.execute
-Inherited from FixedClusterPool.findFreeWorker
-Inherited from FixedClusterPool.getWorkerAverageTasksRunTime
+Inherited from FixedClusterPool.enqueueTask
Inherited from FixedClusterPool.getWorkerIndex
+Inherited from FixedClusterPool.execute
Inherited from FixedClusterPool.getWorkerRunningTasks
+Inherited from FixedClusterPool.findFreeWorkerNodeKey
Protected
flushInherited from FixedClusterPool.initWorkerTasksUsage
+Inherited from FixedClusterPool.flushTasksQueue
Protected
internalProtected
flushInherited from FixedClusterPool.internalExecute
+Inherited from FixedClusterPool.flushTasksQueueByWorker
Protected
internalProtected
internalInherited from FixedClusterPool.internalGetBusyStatus
+Inherited from FixedClusterPool.internalBusy
Protected
isInherited from FixedClusterPool.isMain
Inherited from FixedClusterPool.registerWorkerMessageListener
Protected
removeProtected
removeRemoves the given worker from the pool.
+Removes the given worker from the pool worker nodes.
Worker that will be removed.
+The worker.
Inherited from FixedClusterPool.removeWorker
+Inherited from FixedClusterPool.removeWorkerNode
Protected
sendInherited from FixedClusterPool.sendToWorker
Inherited from FixedClusterPool.setWorkerChoiceStrategy
Protected
setupInherited from FixedClusterPool.setupHook
Protected
tasksInherited from FixedClusterPool.tasksQueueLength
+Protected
workerThis function is the listener registered for each worker.
+This 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.
+This function is the listener registered for each worker message.
The listener function to execute when a message is received from a worker.
Inherited from FixedClusterPool.workerListener
Generated using TypeDoc
A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
This cluster pool creates new workers when the others are busy, up to the maximum number of workers. -When the maximum number of workers is reached, an event is emitted. If you want to listen to this event, use the pool's
- -emitter
.Template
of data sent to the worker. This can only be serializable data.
- -Template
of response of execution. This can only be serializable data.
+When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool'semitter
.Author
Christopher Quadflieg
@@ -30,9 +28,13 @@ When the maximum number of workers is reached, an event is emitted. If you wantType Parameters
Data = unknown
Data = unknown
+Type of data sent to the worker. This can only be serializable data.
+Response = unknown
Response = unknown
+Type of response of execution. This can only be serializable data.
+Hierarchy
@@ -40,7 +42,7 @@ When the maximum number of workers is reached, an event is emitted. If you want- DynamicClusterPool
@@ -54,45 +56,45 @@ When the maximum number of workers is reached, an event is emitted. If you wantemitter?
file Path
-max
-next Message Id
+max
number Of Workers
opts
-promise Map
+promise Response Map
worker Choice Strategy Context
-workers
-workers Tasks Usage
+worker Nodes
Properties
Accessors
Methods
-constructor
-- new
Dynamic Cluster Pool<Data, Response>(min: number, max: number, filePath: string, opts??: ClusterPoolOptions): DynamicClusterPool<Data, Response>
+- new
Dynamic Cluster Pool<Data, Response>(min: number, max: number, filePath: string, opts?: ClusterPoolOptions): DynamicClusterPool<Data, Response>
-
@@ -127,95 +129,84 @@ When the maximum number of workers is reached, an event is emitted. If you want
-
-
Constructs a new poolifier dynamic cluster pool.
Path to an implementation of a
ClusterWorker
file, which can be relative or absolute.
+Optional
opts: ClusterPoolOptions = {}opts: ClusterPoolOptions = {}
Options for this dynamic cluster pool.
Returns DynamicClusterPool<Data, Response>