X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=c0ec5c9fe7ce8aeb529270abc81e7d2303327642;hb=ef9f489c870680b9a754ab8e5b142b3f042a9ebb;hp=07b7c79bbc65455adbdddab95bdb063b35eb31e1;hpb=f05afd162e34836a52c48b05781750e3421424d8;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 07b7c79b..c0ec5c9f 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,10 @@ When the maximum number of workers is reached and workers are busy, an event is info max Size
min Size
+ready
+starting
type
+utilization
worker
Properties
Emitter on which events can be listened to.
Events that can currently be listened to:
-
-
+
+
+
@@ -159,7 +163,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 +258,7 @@ When the maximum number of workers is reached and workers are busy, an event is
info
@@ -267,7 +270,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
max@@ -279,7 +282,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
min@@ -291,7 +294,25 @@ When the maximum number of workers is reached and workers are busy, an event is
+Private
ready+- get ready(): boolean
+-
+
Returns boolean
+Private
starting+- get starting(): boolean
+-
+
Returns boolean
Protected
type@@ -304,7 +325,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 +350,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.