X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=78dbcdde025b4d55253ed5cbba6d59773b5565a6;hb=388a5bee28fb64a2743d65189afd0a6e63314819;hp=5fdaa92817429cbe2750d4ff6ca0a2d3793fac32;hpb=6c2aa71d06cfeccb07a325f7d9bc5ecdbb42a11f;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 5fdaa928..78dbcdde 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,9 +1,9 @@ -
Protected
Readonly
workerThis method is the message listener registered on each worker.
+
A thread pool with a fixed number of threads.
+- Preparing search index...
- The search index is not available
poolifier - v4.0.13Class FixedThreadPool<Data, Response>
A thread pool with a fixed number of threads.
Author
Alessandro Pio Ardizio
Since
0.0.1
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
Type Parameters
Parameters
Number of threads for this pool.
Path to an implementation of a
ThreadWorker
file, which can be relative or absolute.Options for this fixed thread pool.
-Optional
maximumNumberOfThreads: numberReturns FixedThreadPool<Data, Response>
Properties
Optional
emitterPool event emitter integrated with async resource. +
Optional
maximumNumberOfThreads: numberReturns FixedThreadPool<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,73 +69,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 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 strategies context referencing worker choice algorithms 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: 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.
+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
isReturns whether the worker is the main worker or not.
+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
Protected
registerRegisters once a listener callback on the worker given its worker node key.
+list Task Functions Properties
Returns TaskFunctionProperties[]
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.
Optional
transferList: readonly TransferListItem[]The optional array of transferable objects.
-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 boolean
Inherit Doc
Protected
setupSetup hook to execute code before worker nodes are created in the abstract constructor. +
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 boolean
Inherit Doc
Protected
setupSetup hook to execute code before worker nodes are created in the abstract constructor. Can be overridden.
-Returns void
Protected
shallConditions for dynamic worker creation.
+Returns void
Protected
shallConditions for dynamic worker creation.
Returns boolean
Whether to create a dynamic worker or not.
-start
Returns void
Inherit Doc
Protected
Readonly
workerThis method is the message listener registered on each worker.
-Parameters
Returns void
Settings
Member Visibility
Theme
On This Page