X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FDynamicThreadPool.html;h=3083ab435c6c8158da59846b0a86bfd8f79e5524;hb=f33c2d55c063a50c0025bf707fa4faf7a5e25f6e;hp=1c910446e4d5bddd560bce69f3da8d72ff1a79fc;hpb=15d6dfaf877ec6a99e2bde48cb3c8a9e8671c075;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 1c910446..3083ab43 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,4 +1,4 @@ -
Emitter on which events can be listened to.
Events that can currently be listened to:
'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
optsOptions for the pool.
+ +Options for this fixed thread pool.
Protected
promiseThe execution response promise map.
key
: The message id of each submitted task.Protected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Default to a round robin algorithm.
Readonly
workerPool worker nodes.
Protected
fullProtected
maxProtected
minPrivate
readyPrivate
startingProtected
typePrivate
utilizationGets the approximate pool utilization.
+The pool utilization.
+ +Protected
workerThe worker.
The received message.
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.
The newly created worker.
Protected
beforeHook executed before the worker task execution. Can be overridden.
@@ -381,75 +415,96 @@ Can be overridden.The worker node key.
The task to execute.
+Protected
chooseProtected
checkProtected
createChooses a worker node for the next task.
-The default worker choice strategy uses a round robin algorithm to distribute the load.
+Creates a new dynamic worker and sets it up completely in the pool worker nodes.
The worker node key
+New, completely set up dynamic worker.
+Protected
createCreates a new worker and sets it up completely in the pool worker nodes.
New, completely set up worker.
+New, completely set up worker.
Protected
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.
A worker within workerNodes
.
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 FixedThreadPool.isMain
Protected
registerRegisters a listener callback on the given worker.
-The worker which should register a listener.
-The message listener callback.
-Inherited from FixedThreadPool.registerWorkerMessageListener
-Protected
sendThe worker which should receive the message.
The message.
Inherited from FixedThreadPool.sendToWorker
Inherited from FixedThreadPool.setTasksQueueOptions
The worker choice strategy.
Inherited from FixedThreadPool.setWorkerChoiceStrategy
Inherited from FixedThreadPool.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 FixedThreadPool.setupHook
Protected
workerThe listener function to execute when a message is received from a worker.
Inherited from FixedThreadPool.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 threads is reached and workers are busy, an event is info max Size
min Size
+ready
+starting
type
+utilization
worker
opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
+opts: ThreadPoolOptions = {}
Options for this dynamic thread pool.