Protected
promiseThe promise map.
+Protected
promiseThe execution response promise 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 execution response 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 id.
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
workers{@inheritDoc}
-Inherited from FixedClusterPool.workers
-Readonly
workers{@inheritDoc}
-Inherited from FixedClusterPool.workersTasksUsage
+Readonly
workerInherited from FixedClusterPool.workerNodes
{@inheritDoc}
-Overrides FixedClusterPool.busy
Overrides FixedClusterPool.full
+Private
numberNumber of tasks queued in the pool.
+Inherited from FixedClusterPool.numberOfQueuedTasks
+Private
number{@inheritDoc}
+Number of tasks running in the pool.
Inherited from FixedClusterPool.numberOfRunningTasks
{@inheritDoc}
-Overrides FixedClusterPool.type
Protected
afterProtected
afterHook executed after the worker task promise resolution. Can be overridden.
@@ -270,24 +272,24 @@ Can be overridden.The received message.
+The worker.
The Promise response.
+The received message.
Inherited from FixedClusterPool.afterPromiseWorkerResponseHook
+Inherited from FixedClusterPool.afterPromiseResponseHook
Protected
after{@inheritDoc}
-Inherited from FixedClusterPool.afterWorkerSetup
Protected
beforeProtected
beforeHook executed before the worker task promise resolution. Can be overridden.
@@ -309,69 +311,69 @@ 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
create{@inheritDoc}
-Inherited from FixedClusterPool.createWorker
{@inheritDoc}
-Inherited from FixedClusterPool.destroy
{@inheritDoc}
-Inherited from FixedClusterPool.destroyWorker
{@inheritDoc}
-Inherited from FixedClusterPool.execute
{@inheritDoc}
-Inherited from FixedClusterPool.findFreeWorker
-{@inheritDoc}
-Inherited from FixedClusterPool.getWorkerAverageTasksRunTime
-{@inheritDoc}
-Inherited from FixedClusterPool.getWorkerIndex
+Inherited from FixedClusterPool.findFreeWorkerNodeKey
{@inheritDoc}
-Inherited from FixedClusterPool.getWorkerRunningTasks
-Protected
internalProtected
internalInherited from FixedClusterPool.internalGetBusyStatus
+Inherited from FixedClusterPool.internalBusy
Protected
is{@inheritDoc}
-Inherited from FixedClusterPool.isMain
{@inheritDoc}
-Inherited from FixedClusterPool.registerWorkerMessageListener
Protected
removeRemoves the given worker from the pool.
-The worker that will be removed.
-Inherited from FixedClusterPool.removeWorker
-Protected
send{@inheritDoc}
-Inherited from FixedClusterPool.sendToWorker
{@inheritDoc}
-Inherited from FixedClusterPool.setWorkerChoiceStrategy
Protected
setup{@inheritDoc}
-Inherited from FixedClusterPool.setupHook
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
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
+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
.emitter
.Author
Christopher Quadflieg
@@ -42,7 +42,7 @@ When the maximum number of workers is reached, an event is emitted. If you want@@ -56,40 +56,36 @@ 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
-Returns DynamicClusterPool<Data, Response>
+Properties
Optional
Readonly
emitter{@inheritDoc}
-Readonly
fileInherited from FixedClusterPool.filePath
-- Defined in src/pools/abstract-pool.ts:80
+Protected
Readonly
maxReadonly
maxMaximum number of workers that can be created by this pool.
-- Defined in src/pools/cluster/dynamic.ts:30
Message Id
-Protected
nextId of the next message.
-Inherited from FixedClusterPool.nextMessageId
--- Defined in src/pools/abstract-pool.ts:58
Readonly
numberInherited from FixedClusterPool.numberOfWorkers
-- Defined in src/pools/abstract-pool.ts:79
Readonly
optsInherited from FixedClusterPool.opts
-- Defined in src/pools/cluster/fixed.ts:53