X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FDynamicClusterPool.html;h=81c810c16aae3b4668660ce7d0381ece0af9986f;hb=120c7852afd1ce4c01bd7e70cd14eeeedda8c1e3;hp=07b7c79bbc65455adbdddab95bdb063b35eb31e1;hpb=f05afd162e34836a52c48b05781750e3421424d8;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 07b7c79b..81c810c1 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,4 +1,4 @@ -
Protected
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.
Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes. +Can be overridden.
Protected
beforeProtected
chooseProtected
checkChooses a worker node for the next task.
-The default worker choice strategy uses a round robin algorithm to distribute the load.
+Protected
createProtected
createProtected
createReturns a newly created worker.
+Creates a new worker.
Newly created worker.
+ +Shutdowns every current worker in this pool.
+Terminates every current worker in this pool.
Protected
destroyShutdowns the given worker.
+Terminates the given worker.
Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
+The task input data for the specified worker function. This can only be structured-cloneable data.
Protected
internalProtected
isInherited from FixedClusterPool.isMain
Protected
registerRegisters a listener callback on the given worker.
-The worker which should register a listener.
-The message listener callback.
-Inherited from FixedClusterPool.registerWorkerMessageListener
-Protected
sendThe message.
Inherited from FixedClusterPool.sendToWorker
Inherited from FixedClusterPool.setTasksQueueOptions
Inherited from FixedClusterPool.setWorkerChoiceStrategy
Inherited from FixedClusterPool.setWorkerChoiceStrategyOptions
Protected
setupSetup hook to execute code before worker node are created in the abstract constructor. -Can be overridden
+Setup hook to execute code before worker nodes are created in the abstract constructor. +Can be overridden.
Inherited from FixedClusterPool.setupHook
Protected
workerThe listener function to execute when a message is received from a worker.
Inherited from FixedClusterPool.workerListener
Generated using TypeDoc
Type of data sent to the worker. This can only be serializable data.
+Type of data sent to the worker. This can only be structured-cloneable data.
Response = unknown
-Type of execution response. This can only be serializable data.
+Type of execution response. This can only be structured-cloneable data.
@@ -73,7 +73,9 @@ When the maximum number of workers is reached and workers are busy, an event is info max Size
min Size
+ready
type
+utilization
worker
Properties
Emitter on which events can be listened to.
Events that can currently be listened to:
-
-
+
+
+
@@ -159,7 +162,7 @@ When the maximum number of workers is reached and workers are busy, an event is +'full'
: Emitted when the pool is dynamic and full.'busy'
: Emitted when the pool is busy.'full'
: Emitted when the pool is dynamic and the number of workers created has reached the maximum size expected.'ready'
: Emitted when the number of workers created in the pool has reached the minimum size expected and are ready.'busy'
: Emitted when the number of workers created in the pool has reached the maximum size expected and are executing at least one task.'error'
: Emitted when an uncaught error occurs.'taskError'
: Emitted when an error occurs while executing a task.Protected
Readonly
fileProtected
Readonly
maxProtected
Readonly
numberProtected
Readonly
optsProtected
promiseProtected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Default to a round robin algorithm.
Nodes
-Readonly
workerPool worker nodes.
Accessors
Protected
full@@ -255,7 +257,7 @@ When the maximum number of workers is reached and workers are busy, an event is
info
@@ -267,7 +269,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
max@@ -279,7 +281,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
min@@ -291,7 +293,16 @@ When the maximum number of workers is reached and workers are busy, an event is
+Private
ready+- get ready(): boolean
+-
+
Returns boolean
Protected
type@@ -304,7 +315,20 @@ When the maximum number of workers is reached and workers are busy, an event is
+Private
utilization+- get utilization(): number
+-
+
+
Gets the approximate pool utilization.
+Returns number
The pool utilization.
+ +Protected
worker@@ -316,7 +340,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Methods
message: MessageValue<Response, unknown, Worker | MessagePort>
+message: MessageValue<Response, unknown>
The received message.