X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=0f4602aaf20da14fd3c5df2dde50af0994d1cc3b;hb=b947a3c07cfccf3bbb1a8a52ac0274bbd3084e6a;hp=ea3cabe8ef8dcb5349a25f3e03e0490cb30c82f6;hpb=5dd39e0fba309bb3af0ca64aea5205f57dfe5d24;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index ea3cabe8..0f4602aa 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,722 +1,141 @@ -
Type of data sent to the worker. This can only be serializable data.
-Type of execution response. This can only be serializable data.
-Constructs a new poolifier fixed thread pool.
-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
Readonly
emitterEmitter on which events can be listened to.
+A thread pool with a fixed number of threads.
+Constructs a new poolifier fixed thread pool.
+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: numberOptional
emitterPool event emitter integrated with async resource.
+The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool
.
Events that can currently be listened to:
'full'
: Emitted when the pool is dynamic and full.'busy'
: Emitted when the pool is busy.'ready'
: Emitted when the number of workers created in the pool has reached the minimum size expected and are ready. If the pool is dynamic with a minimum number of workers is set to zero, this event is emitted when at least one dynamic worker is ready.'busy'
: Emitted when the number of workers created in the pool has reached the maximum size expected and are executing concurrently their tasks quota.'full'
: Emitted when the pool is dynamic and the number of workers created has reached the maximum size expected.'empty'
: Emitted when the pool is dynamic with a minimum number of workers set to zero and the number of workers has reached the minimum size expected.'destroy'
: Emitted when the pool is destroyed.'error'
: Emitted when an uncaught error occurs.'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).Readonly
filePath to the worker file.
-Readonly
numberNumber of workers that this pool should manage.
-Readonly
optsOptions for the pool.
-Protected
promiseThe 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
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Default to a round robin algorithm.
-Readonly
workerPool worker nodes.
-Protected
busyWhether the pool is busy or not.
+Protected
Optional
workerWorker choice strategies context referencing worker choice algorithms implementation.
+Readonly
Internal
workerPool worker nodes.
+Protected
busyWhether the pool is busy or not.
The pool busyness boolean status.
-Protected
fullWhether the pool is full or not.
+Protected
emptyThe pool emptiness boolean status.
+Protected
fullWhether the pool is full or not.
The pool filling boolean status.
-Private
numberNumber of tasks queued in the pool.
-Private
numberNumber of tasks running in the pool.
-Pool maximum size.
-Pool type.
+Private
readyThe pool readiness boolean status.
+Protected
typeThe pool type.
If it is 'dynamic'
, it provides the max
property.
Protected
afterPrivate
utilizationThe approximate pool utilization.
+The pool utilization.
+Protected
workerThe worker type.
+Protected
afterHook executed after the worker task execution. Can be overridden.
-The 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.
The newly created worker.
-Protected
beforeHook executed before the worker task execution. +
The worker node key.
+The received message.
+Protected
afterProtected
chooseChooses a worker node for the next task.
-The default uses a round robin algorithm to distribute the load.
-[worker node key, worker node].
-Protected
createCreates a new worker and sets it up completely in the pool worker nodes.
-New, completely set up worker.
-Protected
createReturns a newly created worker.
-Protected
destroyShutdowns the given worker.
-A worker within workerNodes
.
Enables/disables the worker tasks queue in this pool.
-Whether to enable or disable the worker tasks queue.
-Optional
tasksQueueOptions: TasksQueueOptionsThe worker tasks queue options.
-Executes the specified function in the worker constructor with the task data input parameter.
-Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
-Optional
name: stringThe name of the worker function to execute. If not specified, the default worker function will be executed.
-Promise that will be fulfilled when the task is completed.
-Protected
internalProtected
isProtected
registerRegisters a listener callback on the given worker.
-The worker which should register a listener.
-The message listener callback.
-Protected
sendSends a message to the given worker.
-The worker which should receive the message.
-The message.
-Sets the worker tasks queue options in this pool.
-The worker tasks queue options.
-Sets the worker choice strategy in this pool.
-The worker choice strategy.
-Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsThe worker choice strategy options.
-Sets the worker choice strategy options in this pool.
-The worker choice strategy options.
-Protected
setupProtected
workerThis function is the listener registered for each worker message.
-The listener function to execute when a message is received from a worker.
- -This function is the listener registered for each worker message.
-The listener function to execute when a message is received from a worker.
-Generated using TypeDoc
The newly created worker node key.
+Protected
beforeProtected
checkProtected
createProtected
createProtected
deregisterDeregisters a listener callback on the worker given its worker node key.
+The worker node key.
+The message listener callback.
+Protected
destroyOptional
tasksQueueOptions: TasksQueueOptionsProtected
flagProtected
flushProtected
getGets the worker information given its worker node key.
+The worker node key.
+The worker information.
+Protected
internalProtected
isProtected
registerRegisters once a listener callback on the worker given its worker node key.
+The worker node key.
+The message listener callback.
+Protected
registerRegisters a listener callback on the worker given its worker node key.
+The worker node key.
+The message listener callback.
+Protected
sendProtected
sendSends a message to worker given its worker node key.
+The worker node key.
+The message.
+Optional
transferList: readonly TransferListItem[]The optional array of transferable objects.
+Optional
workerChoiceStrategyOptions: WorkerChoiceStrategyOptionsProtected
setupProtected
shallProtected
Readonly
workerThis method is the message listener registered on each worker.
+
A thread pool with a fixed number of threads.
-It is possible to perform tasks in sync or asynchronous mode as you prefer.
-This pool selects the threads in a round robin fashion.
- -Author
Alessandro Pio Ardizio
- -Since
0.0.1
-