X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractPool.html;h=fefd813870f27d18870841a4aa642465a9740322;hb=8d98e603c79d8d00b2b6a33e5f732701a7466234;hp=4f1fb233f737bf41574a31354a99bec2774ba5d9;hpb=6047493a00c2852f2c7f4329def8e1322c678cf1;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index 4f1fb233..fefd8138 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,4 +1,4 @@ -
Implementation of IPool.enableTasksQueue
+Implementation of IPool.enableTasksQueue
Private
enqueueExecutes the function specified in the constructor with the task data parameter.
- -Promise that will be resolved when the task is successfully completed.
+Executes the specified function in the worker constructor with the task data input parameter.
The input for the specified task. This can only be serializable data.
+Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
+Optional
name: stringThe name of the worker function to execute. If not specified, the default worker function will be executed.
Implementation of IPool.execute
+Promise that will be fulfilled when the task is completed.
+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.
- -The worker node key if the worker is found in the pool worker nodes, -1
otherwise.
The worker.
The worker node key if the worker is found in the pool worker nodes, -1
otherwise.
Private
getGets the given worker its tasks usage in the pool.
- -Error if the worker is not found in the pool worker nodes.
- -The worker tasks usage.
-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.
- -The worker nodes length.
The worker.
The worker nodes length.
+Protected
Abstract
registerThe worker which should register a listener.
The message listener callback.
Private
removeRemoves the given worker from the pool worker nodes.
The worker.
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
+Implementation of IPool.setTasksQueueOptions
Sets the worker choice strategy in this pool.
The worker choice strategy.
+Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsThe worker choice strategy options.
Implementation of IPool.setWorkerChoiceStrategy
+Implementation of IPool.setWorkerChoiceStrategy
Sets the worker choice strategy options in this pool.
The worker choice strategy options.
Implementation of IPool.setWorkerChoiceStrategyOptions
+Implementation of IPool.setWorkerChoiceStrategyOptions
Private
setSets the given worker in the pool worker nodes.
The worker node key.
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
tasksPrivate
updatePrivate
updateProtected
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.
+Generated using TypeDoc
Base class that implements some shared logic for all poolifier pools.