X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FDynamicClusterPool.html;h=09bddee613cddcf688eac0525f44ba4128bb51e8;hb=310ec53bbcd0289d0d0f7d254f7d8fc38db05ad9;hp=0fcdc4ccc02f2cdf0249c85164582b2b69721bf6;hpb=fe9f25b5ac98c7c7fccd1849a200c5054a77cf03;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 0fcdc4cc..09bddee6 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,11 +1,13 @@
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
.
of data sent to the worker. This can only be serializable data.
- -of response of execution. This can only be serializable data.
-2.0.0
@@ -30,9 +28,13 @@ When the maximum number of workers is reached, an event is emitted. If you wantType of response of execution. This can only be serializable data.
+Constructs a new poolifier dynamic cluster pool.
Path to an implementation of a ClusterWorker
file, which can be relative or absolute.
Optional
opts: ClusterPoolOptions = {}Options for this dynamic cluster pool.
Optional
Readonly
emitterReadonly
filePath to the worker-file.
+Inherited from FixedClusterPool.filePath
Readonly
maxProtected
Readonly
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
Readonly
tasksInherited from FixedClusterPool.tasks
-Protected
workerInherited from FixedClusterPool.workerChoiceStrategyContext
Readonly
workers{@inheritDoc}
+Inherited from FixedClusterPool.workers
{@inheritDoc}
+Overrides FixedClusterPool.busy
{@inheritDoc}
+Inherited from FixedClusterPool.numberOfRunningTasks
{@inheritDoc}
+Overrides FixedClusterPool.type
Protected
afterHook executed after the worker task promise resolution. +Can be overridden.
+The worker.
+The received message.
+Inherited from FixedClusterPool.afterPromiseResponseHook
+Protected
after{@inheritDoc}
+Inherited from FixedClusterPool.afterWorkerSetup
Protected
beforeHook executed before the worker task promise resolution. +Can be overridden.
+The worker key.
+Inherited from FixedClusterPool.beforePromiseResponseHook
+Protected
chooseChoose a worker for the next task.
+Chooses a worker for the next task.
The default implementation uses a round robin algorithm to distribute the load.
-Worker.
+[worker key, worker].
Inherited from FixedClusterPool.chooseWorker
Protected
createInherited from FixedClusterPool.createAndSetupWorker
Protected
create{@inheritDoc}
+Inherited from FixedClusterPool.createWorker
Protected
decreaseDecrease the number of tasks that the given worker has applied.
-Worker whose tasks are decreased.
-Inherited from FixedClusterPool.decreaseWorkersTasks
-{@inheritDoc}
+Inherited from FixedClusterPool.destroy
{@inheritDoc}
+Inherited from FixedClusterPool.destroyWorker
{@inheritDoc}
+Inherited from FixedClusterPool.execute
Inherited from FixedClusterPool.findFreeWorker
-Inherited from FixedClusterPool.getWorkerIndex
-Inherited from FixedClusterPool.getWorkerRunningTasks
-Protected
increaseIncrease the number of tasks that the given worker has applied.
+{@inheritDoc}
Worker whose tasks are increased.
-Inherited from FixedClusterPool.increaseWorkersTask
+Inherited from FixedClusterPool.findFreeWorkerKey
Protected
internalInherited from FixedClusterPool.internalExecute
-Protected
internalInherited from FixedClusterPool.internalGetBusyStatus
Protected
is{@inheritDoc}
+Inherited from FixedClusterPool.isMain
{@inheritDoc}
+Inherited from FixedClusterPool.registerWorkerMessageListener
Protected
removeWorker that will be removed.
+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
workerInherited from FixedClusterPool.workerListener
Type of data sent to the worker. This can only be serializable data.
+