X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractPool.html;h=3e8972e96258662bea8323a7764dbc3ab11fac57;hb=938d9c678aa8e70e5642feffb90604cf25c993fe;hp=3369cea5901f6a284d7d22a457d08172a5593a7c;hpb=3bd6a82e43e11294af91bbd19647944ac740169e;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index 3369cea5..3e8972e9 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -22,7 +22,7 @@
Constructs a new poolifier pool.
Path to the worker file.
Options for the pool.
Optional
Readonly
emitterEmitter on which events can be listened to.
Events that can currently be listened to:
Implementation of IPool.emitter
Readonly
filePath to the worker file.
Readonly
numberNumber of workers that this pool should manage.
Readonly
optsOptions for the pool.
Protected
promiseThe execution response promise map.
key
: The message id of each submitted task.When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.
Protected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
Default to a round robin algorithm.
Readonly
workerPool worker nodes.
Implementation of IPool.workerNodes
Protected
Abstract
fullPrivate
numberPrivate
numberAbstract
typeProtected
afterHook executed after the worker task execution. Can be overridden.
@@ -290,16 +289,16 @@ Can be overridden.The worker.
The received message.
Protected
Abstract
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.
Protected
beforeHook executed before the worker task execution. Can be overridden.
@@ -331,32 +330,32 @@ Can be overridden.Private
buildPrivate
checkPrivate
checkPrivate
checkPrivate
checkPrivate
checkPrivate
checkProtected
chooseChooses a worker node for the next task.
The default uses a round robin algorithm to distribute the load.
[worker node key, worker node].
Protected
createCreates a new worker and sets it up completely in the pool worker nodes.
@@ -442,45 +441,45 @@ Can be overridden.Protected
Abstract
createReturns a newly created worker.
Private
dequeueShutdowns every current worker in this pool.
Implementation of IPool.destroy
Protected
Abstract
destroyShutdowns the given worker.
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.
Implementation of IPool.enableTasksQueue
Private
enqueueExecutes the function specified in the worker constructor with the task data input parameter.
@@ -550,11 +549,11 @@ Can be overridden.Implementation of IPool.execute
Private
executeFinds 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.
Implementation of IPool.findFreeWorkerNodeKey
-Private
flushPrivate
flushPrivate
flushPrivate
getGets the given worker its worker node key.
@@ -633,11 +617,11 @@ Can be overridden.Private
getGets the given worker its tasks usage in the pool.
@@ -652,31 +636,31 @@ Can be overridden.The worker.
Protected
internalProtected
Abstract
isShould return whether the worker is the main worker or not.
Private
pushPushes the given worker in the pool worker nodes.
@@ -691,11 +675,11 @@ Can be overridden.Protected
Abstract
registerRegisters a listener callback on the given worker.
Private
removeRemoves the given worker from the pool worker nodes.
Protected
Abstract
sendSends a message to the given worker.
The worker which should receive the message.
The message.
Sets the worker tasks queue options in this pool.
The worker tasks queue options.
Implementation of IPool.setTasksQueueOptions
Sets the worker choice strategy in this pool.
The worker choice strategy.
Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsOptional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsThe worker choice strategy options.
Implementation of IPool.setWorkerChoiceStrategy
Sets the worker choice strategy options in this pool.
The worker choice strategy options.
Implementation of IPool.setWorkerChoiceStrategyOptions
Private
setSets the given worker in the pool worker nodes.
The worker.
The worker tasks usage.
The worker task queue.
Private
setSets the given worker node its tasks usage in the pool.
The worker node.
The worker node tasks usage.
Protected
setupSetup hook to execute code before worker node are created in the abstract constructor. Can be overridden
Private
tasksProtected
workerThis function is the listener registered for each worker message.
@@ -922,10 +906,10 @@ Can be overridden
Type of worker which manages this pool.