X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=f0527fbc8a7d21c31668e49f1bf478e704199743;hb=239d22372bddd21106b22361038be2f3aae6e5de;hp=0449c9293d28a70e3797c72fd487045d55f6c5a7;hpb=281c4c4798ff3366a0efb1f65a80b451804bedab;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 0449c929..f0527fbc 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,16 +1,16 @@ -
Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsProtected
setupProtected
shallProtected
shallProtected
Readonly
workerThis method is the message listener registered on each worker.
-Generated using TypeDoc
Protected
Readonly
workerThis method is the message listener registered on each worker.
+The message received from the worker.
+
A cluster pool with a fixed number of workers.
+- Preparing search index...
- The search index is not available
poolifier - v4.0.15Class FixedClusterPool<Data, Response>
A cluster pool with a fixed number of workers.
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
Type Parameters
Parameters
Number of workers for this pool.
Path to an implementation of a
ClusterWorker
file, which can be relative or absolute.Options for this fixed cluster pool.
-Optional
maximumNumberOfWorkers: numberReturns FixedClusterPool<Data, Response>
Properties
Optional
emitterEvent emitter integrated with async resource on which events can be listened to. +
Optional
maximumNumberOfWorkers: numberThe maximum number of workers for this pool.
+Returns FixedClusterPool<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:
@@ -69,71 +71,75 @@ 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.
-The pool busyness boolean status.
-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.
+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.
+Returns boolean
The pool busyness boolean status.
+Protected
emptyWhether the pool is empty or not.
+Returns boolean
The pool emptiness boolean status.
+Protected
fullWhether the pool is full or not.
+Returns boolean
The pool fullness boolean status.
+info
Pool information.
+Returns PoolInfo
Private
readyWhether the pool is ready or not.
+Returns boolean
The pool readiness boolean status.
+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
Protected
sendSends a message to worker given its worker node key.
Parameters
The worker node key.
The message.
-Returns void
set Default Task Function
Parameters
Returns Promise<boolean>
Inherit Doc
set Tasks Queue Options
Parameters
Returns void
Inherit Doc
set Worker Choice Strategy
Parameters
Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsReturns void
Inherit Doc
set Worker Choice Strategy Options
Parameters
Returns void
Inherit Doc
Protected
setupSetup hook to execute code before worker nodes are created in the abstract constructor. +
Returns void