X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=d984f9e17b5570ff7fa0845315d7f4ec069f2821;hb=c5a7f2df1876fa07c28e7888986ba04d8fc6773b;hp=5a6ec61d4cc4164c4b0069333368be83708593dd;hpb=a99f06d1fff8949584cd630bfaa3fa2e3cc3897e;p=poolifier.git
diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html
index 5a6ec61d..d984f9e1 100644
--- a/docs/classes/DynamicClusterPool.html
+++ b/docs/classes/DynamicClusterPool.html
@@ -1,18 +1,18 @@
-
Class DynamicClusterPool<Data, Response> Protected
send To Worker send To Worker ( workerNodeKey , message ) : void Returns void set Default Task Function set Default Task Function ( name ) : Promise < boolean > Returns Promise < boolean > set Tasks Queue Options set Tasks Queue Options ( tasksQueueOptions ) : void Returns void set Worker Choice Strategy set Worker Choice Strategy ( workerChoiceStrategy , workerChoiceStrategyOptions ? ) : void Parameters workerChoiceStrategy : "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN" Optional
workerChoiceStrategyOptions : WorkerChoiceStrategyOptions Returns void set Worker Choice Strategy Options set Worker Choice Strategy Options ( workerChoiceStrategyOptions ) : void Returns void Returns void set Default Task Function set Default Task Function ( name ) : Promise < boolean > Returns Promise < boolean > set Tasks Queue Options set Tasks Queue Options ( tasksQueueOptions ) : void Returns void set Worker Choice Strategy set Worker Choice Strategy ( workerChoiceStrategy , workerChoiceStrategyOptions ? ) : void Parameters workerChoiceStrategy : "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN" Optional
workerChoiceStrategyOptions : WorkerChoiceStrategyOptions Returns void set Worker Choice Strategy Options set Worker Choice Strategy Options ( workerChoiceStrategyOptions ) : boolean Returns boolean Protected
setup Hook setup Hook ( ) : void Returns void Protected
shall Create Dynamic Worker shall Create Dynamic Worker ( ) : boolean Returns void Protected
shall Create Dynamic Worker start start ( ) : void Returns void Protected
Readonly
worker Message Listener worker Message Listener ( message ) : void Returns void
A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
+- Preparing search index...
- The search index is not available
poolifier - v4.0.14Class DynamicClusterPool<Data, Response>
A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.
This cluster pool creates new workers when the others are busy, up to the maximum number of workers. When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's
emitter
.Author
Christopher Quadflieg
Since
2.0.0
Type Parameters
Type of data sent to the worker. This can only be structured-cloneable data.
Type of execution response. This can only be structured-cloneable data.
-Hierarchy (view full)
Index
Constructors
Hierarchy (view full)
Index
Constructors
Properties
Accessors
Maximum number of workers that can be created by this pool.
Path to an implementation of a
ClusterWorker
file, which can be relative or absolute.Options for this dynamic cluster pool.
-Returns DynamicClusterPool<Data, Response>
Properties
Optional
emitterPool event emitter integrated with async resource. +
Returns DynamicClusterPool<Data, Response>
Properties
Optional
emitterPool event emitter integrated with async resource. The async tracking tooling identifier is
poolifier:<PoolType>-<WorkerType>-pool
.Events that can currently be listened to:
@@ -72,71 +73,73 @@ The async tracking tooling identifier is
-poolifier:<PoolType>-<Wo
'taskError'
: Emitted when an error occurs while executing a task.'backPressure'
: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).Protected
Readonly
filePath to the worker file.
-Protected
Optional
Readonly
maximumMaximum number of workers that this pool manages.
-Protected
Readonly
minimumMinimum number of workers that this pool manages.
-Protected
Readonly
optsOptions for the pool.
-Protected
promiseThe task execution response promise map:
+Protected
Readonly
filePath to the worker file.
+Protected
Optional
Readonly
maximumMaximum number of workers that this pool manages.
+Protected
Readonly
minimumMinimum number of workers that this pool manages.
+Protected
Readonly
optsOptions for the pool.
+Protected
promiseThe task execution response promise map:
key
: The message id of each submitted task.value
: An object that contains the worker, the execution response promise resolve and reject callbacks.value
: An object that contains task's worker node key, execution response promise resolve and reject callbacks, async resource.When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.
-Protected
Optional
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Readonly
Internal
workerPool worker nodes.
-Accessors
Protected
busyWhether the pool is busy or not.
+Protected
Optional
workerWorker choice strategies context referencing worker choice algorithms implementation.
+Readonly
Internal
workerPool worker nodes.
+Accessors
Protected
busyWhether the pool is busy or not.
The pool busyness boolean status.
-Returns boolean
Protected
emptyThe pool emptiness boolean status.
-Returns boolean
Protected
fullWhether the pool is full or not.
+Returns boolean
Protected
emptyThe pool emptiness boolean status.
+Returns boolean
Protected
fullWhether the pool is full or not.
The pool filling boolean status.
-Returns boolean
info
Pool information.
-Returns PoolInfo
Private
readyThe pool readiness boolean status.
-Returns boolean
Protected
typeThe pool type.
+Returns boolean
info
Pool information.
+Returns PoolInfo
Private
readyThe pool readiness boolean status.
+Returns boolean
Protected
typeThe pool type.
If it is
-'dynamic'
, it provides themax
property.Returns "fixed" | "dynamic"
Private
utilizationThe approximate pool utilization.
+Returns "fixed" | "dynamic"
Private
utilizationThe approximate pool utilization.
Returns number
The pool utilization.
-Protected
workerThe worker type.
-Returns "thread" | "cluster"
Methods
add Task Function
Parameters
Returns Promise<boolean>
Inherit Doc
Protected
afterHook executed after the worker task execution. +
Protected
workerThe worker type.
+Returns "thread" | "cluster"
Methods
add Task Function
Parameters
Returns Promise<boolean>
Inherit Doc
Protected
afterHook executed after the worker task execution. Can be overridden.
Parameters
The worker node key.
The received message.
-Returns void
Protected
afterMethod hooked up after a worker node has been newly created. +
Returns void
Protected
afterMethod hooked up after a worker node has been newly created. Can be overridden.
Parameters
The newly created worker node key.
-Returns void
Protected
beforeHook executed before the worker task execution. +
Returns void
Protected
beforeHook executed before the worker task execution. Can be overridden.
Parameters
The worker node key.
The task to execute.
-Returns void
Protected
checkEmits dynamic worker creation events.
-Returns void
Protected
createCreates a new, completely set up dynamic worker node.
+Returns void
Protected
checkEmits dynamic worker creation events.
+Returns void
Protected
createCreates a new, completely set up dynamic worker node.
Returns number
New, completely set up dynamic worker node key.
-Protected
createCreates a new, completely set up worker node.
+Protected
createCreates a new, completely set up worker node.
Returns number
New, completely set up worker node key.
-Protected
deregisterDeregisters a listener callback on the worker given its worker node key.
+Protected
deregisterDeregisters a listener callback on the worker given its worker node key.
Type Parameters
Parameters
The worker node key.
The message listener callback.
-Parameters
Returns void
Returns void
destroy
Returns Promise<void>
Inherit Doc
Protected
destroyTerminates the worker node given its worker node key.
+Parameters
Returns void
Returns void
destroy
Returns Promise<void>
Inherit Doc
Protected
destroyTerminates the worker node given its worker node key.
Parameters
The worker node key.
-Returns Promise<void>
enable Tasks Queue
Parameters
Optional
tasksQueueOptions: TasksQueueOptionsReturns void
Inherit Doc
execute
Parameters
Optional
data: DataOptional
name: stringOptional
transferList: TransferListItem[]Returns Promise<Response>
Inherit Doc
Protected
flagParameters
Returns void
Protected
flushParameters
Returns number
Protected
getGets the worker information given its worker node key.
+Returns Promise<void>
enable Tasks Queue
Parameters
Optional
tasksQueueOptions: TasksQueueOptionsReturns void
Inherit Doc
execute
Parameters
Optional
data: DataOptional
name: stringOptional
transferList: readonly TransferListItem[]Returns Promise<Response>
Inherit Doc
Protected
flagParameters
Returns void
Protected
flushParameters
Returns number
Protected
getGets the worker information given its worker node key.
Parameters
The worker node key.
Returns undefined | WorkerInfo
The worker information.
-has Task Function
Parameters
Returns boolean
Inherit Doc
Protected
internalWhether worker nodes are executing concurrently their tasks quota or not.
+has Task Function
Parameters
Returns boolean
Inherit Doc
Protected
internalWhether worker nodes are executing concurrently their tasks quota or not.
Returns boolean
Worker nodes busyness boolean status.
-Protected
isShould return whether the worker is the main worker or not.
-Returns boolean
list Task Function Names
Returns string[]
Inherit Doc
Protected
registerRegisters once a listener callback on the worker given its worker node key.
+Protected
isReturns whether the worker is the main worker or not.
+Returns boolean
+true
if the worker is the main worker,false
otherwise.list Task Functions Properties
Returns TaskFunctionProperties[]
Inherit Doc
map Execute
Parameters
Optional
name: stringOptional
transferList: readonly TransferListItem[]Returns Promise<Response[]>
Inherit Doc
Protected
registerRegisters once a listener callback on the worker given its worker node key.
Type Parameters
Parameters
The worker node key.
The message listener callback.
-Parameters
Returns void
Returns void
Protected
registerRegisters a listener callback on the worker given its worker node key.
+Parameters
Returns void
Returns void
Protected
registerRegisters a listener callback on the worker given its worker node key.
Type Parameters
Parameters
The worker node key.
The message listener callback.
-Parameters
Returns void
Returns void
remove Task Function
Parameters
Returns Promise<boolean>
Inherit Doc
Protected
sendSends the startup message to worker given its worker node key.
+Parameters
Returns void
Returns void
remove Task Function
Parameters
Returns Promise<boolean>
Inherit Doc
Protected
sendSends the startup message to worker given its worker node key.
Parameters
The worker node key.
-Returns void
Protected
sendSends a message to worker given its worker node key.
+Returns void