X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=00e660c95e618f8dc807bf344b24d8ce4c3b39a2;hb=c97a785f1274883c88a77d2bf418ba6480d20d04;hp=a4a272b70f3eca7faa11a45859de6cdf166d38a6;hpb=76b46937556ea55049d5c413aa0a77d0c7f47f48;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index a4a272b7..00e660c9 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -
Protected
Readonly
fileProtected
Readonly
numberProtected
Readonly
optsProtected
promise
The execution response promise map.
+The 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.Protected
workerReadonly
workerAccessors
Protected
full@@ -247,7 +247,7 @@
info
@@ -259,84 +259,87 @@
Protected
maxPool maximum size.
+The pool maximum size.
Returns number
+Protected
minPool minimum size.
+The pool minimum size.
Returns number
+Private
readyReturns boolean
Protected
typePool type.
+The pool type.
If it is
'dynamic'
, it provides themax
property.Returns "fixed" | "dynamic"
Overrides AbstractPool.type
-- Defined in src/pools/thread/fixed.ts:106
Private
utilizationGets the approximate pool utilization.
+The approximate pool utilization.
Returns number
The pool utilization.
Inherited from AbstractPool.utilization
-- Defined in src/pools/abstract-pool.ts:447
Protected
worker-- get worker(): "cluster" | "thread"
+- get worker(): "thread" | "cluster"
-
-
-
+- Defined in src/pools/thread/fixed.ts:125
Task Execution Hook
Gets the worker type.
+The worker type.
Returns "cluster" | "thread"
+Returns "thread" | "cluster"
Overrides AbstractPool.worker
-- Defined in src/pools/thread/fixed.ts:111
Methods
Protected
after-- after
Task Execution Hook(worker, message): void
+- after
Task Execution Hook(workerNodeKey, message): void
-
-
-
-
@@ -358,28 +361,28 @@ Can be overridden.
-
-- Defined in src/pools/abstract-pool.ts:722
+
+ Worker Node Setup
Hook executed after the worker task execution. Can be overridden.
@@ -345,8 +348,8 @@ Can be overridden.Parameters
worker: Worker
-The worker.
+workerNodeKey: number
+The worker node key.
Inherited from AbstractPool.afterTaskExecutionHook
-- Defined in src/pools/abstract-pool.ts:717
Worker Setup
+Protected
afterProtected
after-- after
Worker Setup(worker): void
+- after
Worker Node Setup(workerNodeKey): void
-
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:951
Task Execution Hook
+- Defined in src/pools/abstract-pool.ts:701
Dynamic Pool Size
-
-- Defined in src/pools/abstract-pool.ts:173
+
+ And Setup Dynamic Worker Node
Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes. +
Method hooked up after a worker node has been newly created. Can be overridden.
Parameters
worker: Worker
-The newly created worker.
+workerNodeKey: number
+The newly created worker node key.
Returns void
Inherited from AbstractPool.afterWorkerSetup
+Inherited from AbstractPool.afterWorkerNodeSetup
-- Defined in src/pools/abstract-pool.ts:941
Protected
before@@ -405,7 +408,7 @@ Can be overridden.
Inherited from AbstractPool.beforeTaskExecutionHook
-- Defined in src/pools/abstract-pool.ts:696
Protected
check@@ -421,33 +424,33 @@ Can be overridden.
Returns void
Inherited from AbstractPool.checkDynamicPoolSize
-- Defined in src/pools/abstract-pool.ts:174
And Setup Dynamic Worker
+Protected
createProtected
create-- create
And Setup Dynamic Worker(): Worker
+- create
And Setup Dynamic Worker Node(): number
-
-
-
-
-
-- Defined in src/pools/abstract-pool.ts:900
+
+ And Setup Worker Node
Creates a new dynamic worker and sets it up completely in the pool worker nodes.
+Creates a new, completely set up dynamic worker node.
Returns Worker
New, completely set up dynamic worker.
+Returns number
New, completely set up dynamic worker node key.
Inherited from AbstractPool.createAndSetupDynamicWorker
+Inherited from AbstractPool.createAndSetupDynamicWorkerNode
-- Defined in src/pools/abstract-pool.ts:896
And Setup Worker
+Protected
createProtected
create-- create
And Setup Worker(): Worker
+- create
And Setup Worker Node(): number
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:860
Worker
+- Defined in src/pools/thread/fixed.ts:112
- destroy(): Promise<void>
-
-
-
-- Defined in src/pools/abstract-pool.ts:664
+
+ Worker Node
Creates a new worker and sets it up completely in the pool worker nodes.
+Creates a new, completely set up worker node.
Returns Worker
New, completely set up worker.
+Returns number
New, completely set up worker node key.
Inherited from AbstractPool.createAndSetupWorker
+Inherited from AbstractPool.createAndSetupWorkerNode
-- Defined in src/pools/abstract-pool.ts:856
Protected
create@@ -460,39 +463,39 @@ Can be overridden.
Overrides AbstractPool.createWorker
-- Defined in src/pools/thread/fixed.ts:98
destroy
Terminates every current worker in this pool.
+Terminates all workers in this pool.
Returns Promise<void>
Inherited from AbstractPool.destroy
-- Defined in src/pools/abstract-pool.ts:651
Worker
+Protected
destroyProtected
destroy-- destroy
Worker(worker): Promise<void>
+- destroy
Worker Node(workerNodeKey): Promise<void>
-
-
-
-
-
+- Defined in src/pools/thread/fixed.ts:59
+- Defined in src/pools/abstract-pool.ts:571
-
-- Defined in src/pools/abstract-pool.ts:1163
+
+ Worker Info
Terminates the given worker.
+Terminates the worker node given its worker node key.
Parameters
worker: Worker
-A worker within
+workerNodes
.workerNodeKey: number
+The worker node key.
Returns Promise<void>
Overrides AbstractPool.destroyWorker
+Overrides AbstractPool.destroyWorkerNode
-- Defined in src/pools/thread/fixed.ts:59
enable Tasks Queue
@@ -517,7 +520,7 @@ Can be overridden.
Inherited from AbstractPool.enableTasksQueue
-- Defined in src/pools/abstract-pool.ts:556
execute
@@ -530,12 +533,12 @@ Can be overridden.-
-
-
-- Defined in src/pools/abstract-pool.ts:632
+
+ Tasks Queue
+
+
-Optional
data: DataThe task input data for the specified worker function. This can only be structured-cloneable data.
+The task input data for the specified task function. This can only be structured-cloneable data.
-Optional
name: stringThe name of the worker function to execute. If not specified, the default worker function will be executed.
+The name of the task function to execute. If not specified, the default task function will be executed.
Returns Promise<Response>
Promise that will be fulfilled when the task is completed.
@@ -543,51 +546,42 @@ Can be overridden.Inherited from AbstractPool.execute
-- Defined in src/pools/abstract-pool.ts:616
Worker Info By Worker
+Protected
getProtected
flush-- get
Worker Info By Worker(worker): WorkerInfo
+- flush
Tasks Queue(workerNodeKey): void
-
-
-
-
-
-
-
-
Gets the worker information from the given worker.
-Parameters
worker: Worker
-The worker.
-Returns WorkerInfo
The worker information.
- -Throws
https://nodejs.org/api/errors.html#class-error If the worker is not found.
-Inherited from AbstractPool.getWorkerInfoByWorker
+workerNodeKey: number
Returns void
Inherited from AbstractPool.flushTasksQueue
-- Defined in src/pools/abstract-pool.ts:1067
Worker Node Key
+Protected
getProtected
get-- get
Worker Node Key(worker): number
+- get
Worker Info(workerNodeKey): WorkerInfo
-
-
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:1102
Busy
+- Defined in src/pools/abstract-pool.ts:622
Main
+- Defined in src/pools/thread/fixed.ts:54
Worker Message Listener
Gets the given worker its worker node key.
+Gets the worker information given its worker node key.
Parameters
worker: Worker
-The worker.
+workerNodeKey: number
+The worker node key.
Returns number
The worker node key if found in the pool worker nodes,
+-1
otherwise.Returns WorkerInfo
The worker information.
Inherited from AbstractPool.getWorkerNodeKey
+Inherited from AbstractPool.getWorkerInfo
-- Defined in src/pools/abstract-pool.ts:519
Protected
internal@@ -600,7 +594,7 @@ Can be overridden.
Inherited from AbstractPool.internalBusy
-- Defined in src/pools/abstract-pool.ts:607
Protected
is@@ -612,13 +606,13 @@ Can be overridden.
Overrides AbstractPool.isMain
-- Defined in src/pools/thread/fixed.ts:54
Protected
register-- register
Worker Message Listener<Message>(worker, listener): void
+- register
Worker Message Listener<Message>(workerNodeKey, listener): void
-
-
-
-
-
@@ -653,40 +647,40 @@ Can be overridden.
+- Defined in src/pools/thread/fixed.ts:102
Startup Message To Worker
Registers a listener callback on the given worker.
+Registers a listener callback on the worker given its worker node key.
Type Parameters
@@ -629,8 +623,8 @@ Can be overridden.Parameters
worker: Worker
-The worker which should register a listener.
+workerNodeKey: number
+The worker node key.
Overrides AbstractPool.registerWorkerMessageListener
-- Defined in src/pools/thread/fixed.ts:88
Protected
send-- send
Startup Message To Worker(worker): void
+- send
Startup Message To Worker(workerNodeKey): void
-
-
-
-
+- Defined in src/pools/thread/fixed.ts:86
To Worker
Sends the startup message to the given worker.
+Sends the startup message to worker given its worker node key.
Parameters
worker: Worker
-The worker which should receive the startup message.
+workerNodeKey: number
+The worker node key.
Returns void
Overrides AbstractPool.sendStartupMessageToWorker
-- Defined in src/pools/thread/fixed.ts:73
Protected
send-- send
To Worker(worker, message): void
+- send
To Worker(workerNodeKey, message): void
-
-
-
-
-
@@ -698,7 +692,7 @@ Can be overridden.
+- Defined in src/pools/thread/fixed.ts:76
+- Defined in src/pools/abstract-pool.ts:583
+- Defined in src/pools/abstract-pool.ts:541
+- Defined in src/pools/abstract-pool.ts:560
Hook
+- Defined in src/pools/abstract-pool.ts:685
Listener
- worker
Listener(): ((message) => void)
-
-
- (message): void
-
-
+- Defined in src/pools/abstract-pool.ts:1034
@@ -842,18 +836,18 @@ Can be overridden.
- utilization
- worker
- after
Task Execution Hook
-- after
Worker Setup
+- after
Worker Node Setup
- before
Task Execution Hook
- check
Dynamic Pool Size
-- create
And Setup Dynamic Worker
-- create
And Setup Worker
+- create
And Setup Dynamic Worker Node
+- create
And Setup Worker Node
- create
Worker
- destroy
-- destroy
Worker
+- destroy
Worker Node
- enable
Tasks Queue
- execute
-- get
Worker Info By Worker
-- get
Worker Node Key
+- flush
Tasks Queue
+- get
Worker Info
- internal
Busy
- is
Main
- register
Worker Message Listener
@@ -865,7 +859,7 @@ Can be overridden.
- setup
Hook
- worker
Listener
-
Sends a message to the given worker.
+Sends a message to worker given its worker node key.
Parameters
worker: Worker
-The worker which should receive the message.
+workerNodeKey: number
+The worker node key.
Overrides AbstractPool.sendToWorker
-- Defined in src/pools/thread/fixed.ts:66
set Tasks Queue Options
@@ -718,7 +712,7 @@ Can be overridden.
Inherited from AbstractPool.setTasksQueueOptions
-- Defined in src/pools/abstract-pool.ts:568
set Worker Choice Strategy
@@ -743,7 +737,7 @@ Can be overridden.
Inherited from AbstractPool.setWorkerChoiceStrategy
-- Defined in src/pools/abstract-pool.ts:526
set Worker Choice Strategy Options
@@ -763,7 +757,7 @@ Can be overridden.
Inherited from AbstractPool.setWorkerChoiceStrategyOptions
-- Defined in src/pools/abstract-pool.ts:545
Protected
setup@@ -776,13 +770,13 @@ Can be overridden.
Inherited from AbstractPool.setupHook
-- Defined in src/pools/abstract-pool.ts:680
Protected
workerThis function is the listener registered for each worker message.
+This method is the listener registered for each worker message.
Returns ((message) => void)
The listener function to execute when a message is received from a worker.
@@ -791,7 +785,7 @@ Can be overridden.This function is the listener registered for each worker message.
+This method is the listener registered for each worker message.
Parameters
@@ -804,7 +798,7 @@ Can be overridden.Inherited from AbstractPool.workerListener
-- Defined in src/pools/abstract-pool.ts:992