X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractPool.html;h=e306ebe9c5021637043ffb8fb5f345c46cc09b4e;hb=4e1212db1d198963828820471bde6902277d0388;hp=bf67558965e87ec5bc4d2f7b7682f78b2cde7b5f;hpb=15d6dfaf877ec6a99e2bde48cb3c8a9e8671c075;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index bf675589..e306ebe9 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,13 +1,13 @@ -
Type of data sent to the worker. This can only be serializable data.
+Type of data sent to the worker. This can only be structured-cloneable data.
Response = unknown
-Type of execution response. This can only be serializable data.
+Type of execution response. This can only be structured-cloneable data.
-
+Index
Index
Constructors
-Properties
-Accessors
-Methods
-Constructors
constructor
+constructor
Type Parameters
Worker extends IWorker<Worker>
Worker extends IWorker
Data = unknown
Returns AbstractPool<Worker, Data, Response>
Properties
Emitter on which events can be listened to.
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.'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.'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).Protected
Readonly
file
+Protected
Optional
Readonly
maxDynamic pool maximum size property placeholder.
+Protected
Readonly
numberProtected
Readonly
opts Response Map
-Protected
promiseThe 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. Timestamp
+Private
Readonly
startThe start timestamp of the pool.
+
+Private
startedWhether the pool is started or not.
+
+Private
Readonly
startingWhether the pool is starting or not.
+Protected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Default to a round robin algorithm.
Nodes
-Readonly
worker Nodes
+Readonly
Internal
workerPool worker nodes.
Accessors
Returns boolean
Protected
full@@ -260,7 +324,7 @@
Returns boolean
info
@@ -272,58 +336,103 @@
Size
+Protected
Abstract
maxProtected
maxPool maximum size.
+The pool maximum size.
Returns number
+ Size
+Protected
Abstract
minProtected
minPool minimum size.
+The pool minimum size.
Returns number
+
+Private
ready+- get ready(): boolean
+-
+
+
The pool readiness boolean status.
+Returns boolean
+Protected
Abstract
typePool type.
+The pool type.
If it is
'dynamic'
, it provides themax
property.Returns "fixed" | "dynamic"
+
+Private
utilization+- get utilization(): number
+-
+
+
The approximate pool utilization.
+Returns number
The pool utilization.
+ +Protected
Abstract
worker-- get worker(): "cluster" | "thread"
+- get worker(): "thread" | "cluster"
-
-
-- Defined in src/pools/abstract-pool.ts:550
+
Task Execution Hook
+- Defined in src/pools/abstract-pool.ts:169
Pool Options
Gets the worker type.
+The worker type.
Returns "cluster" | "thread"
+Returns "thread" | "cluster"
+Methods
+ Worker Node
+Private
add+- add
Worker Node(worker): number
+-
+
+
+
+
+
Adds the given worker in the pool worker nodes.
+Parameters
++-
+
+
worker: Worker
+The worker.
+Returns number
The added worker node key.
+ +Throws
https://nodejs.org/api/errors.html#class-error If the added worker node is not found.
+Protected
after-- after
Task Execution Hook(worker, message): void
+- after
Task Execution Hook(workerNodeKey, message): void
-
-
-
-
-
-
-- Defined in src/pools/abstract-pool.ts:888
+
+ Worker Node Setup
+- Defined in src/pools/abstract-pool.ts:156
+
+
Number Of Workers
Hook executed after the worker task execution. Can be overridden.
@@ -332,43 +441,43 @@ Can be overridden.Parameters
worker: Worker
-The worker.
+workerNodeKey: number
+The worker node key.
message: MessageValue<Response, Worker | MessagePort>
+message: MessageValue<Response, unknown>
The received message.
Returns void
Worker Setup
+Protected
Abstract
afterProtected
after-- after
Worker Setup(worker): void
+- after
Worker Node Setup(workerNodeKey): void
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:1162
Task Execution Hook
+- Defined in src/pools/abstract-pool.ts:858
Tasks Queue Options
-- Defined in src/pools/abstract-pool.ts:672
+
+ And Emit Dynamic Worker Creation Events
+- Defined in src/pools/abstract-pool.ts:1393
+
+
+
+
+
+
File Path
Function 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 themain-worker
<->worker
connection if not bind by default.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
Protected
before-- before
Task Execution Hook(workerNodeKey): void
+- before
Task Execution Hook(workerNodeKey, task): void
-
+
+-
+
Hook executed before the worker task execution. Can be overridden.
@@ -380,11 +489,16 @@ Can be overridden.workerNodeKey: number
The worker node key.
task: Task<Data>
+The task to execute.
+Returns void
Private
build@@ -397,15 +511,46 @@ Can be overridden.
tasksQueueOptions: TasksQueueOptions
Returns TasksQueueOptions
- And Emit Events
+Private
checkPrivate
check-- check
And Emit Events(): void
+- check
And Emit Dynamic Worker Creation Events(): void
-
Returns void
And Emit Task Execution Events
+Private
check+- check
And Emit Task Execution Events(): void
+-
+
Returns void
And Emit Task Queuing Events
+Private
check+- check
And Emit Task Queuing Events(): void
+-
+
Returns void
Dynamic Pool Size
+Protected
check+- check
Dynamic Pool Size(min, max): void
+-
+
+
+
Parameters
++-
+
+-
+
min: number
max: number
Returns void
Private
check@@ -418,7 +563,28 @@ Can be overridden.
filePath: string
Returns void
Message Worker Id
+Private
check+- check
Message Worker Id(message): void
+-
+
+
+
+
+
Checks if the worker id sent in the received message from a worker is valid.
+Parameters
++-
+
+
message: MessageValue<Response, unknown>
+The received message.
+Returns void
+Throws
https://nodejs.org/api/errors.html#class-error If the worker id is invalid.
+Private
check@@ -431,7 +597,7 @@ Can be overridden.
numberOfWorkers: number
Returns void
Private
check@@ -444,7 +610,7 @@ Can be overridden.
opts: PoolOptions<Worker>
Returns void
Private
check@@ -457,7 +623,7 @@ Can be overridden.
tasksQueueOptions: TasksQueueOptions
Returns void
Private
check@@ -467,10 +633,10 @@ Can be overridden.-
-
Parameters
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
Returns void
Private
check@@ -483,43 +649,56 @@ Can be overridden.
workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
Returns void
Worker Node
-Protected
choose+- Defined in src/pools/abstract-pool.ts:251
Worker Node
+Private
chooseChooses a worker node for the next task.
-The default worker choice strategy uses a round robin algorithm to distribute the load.
+The default worker choice strategy uses a round robin algorithm to distribute the tasks.
+Returns number
The chosen worker node key
+ + And Setup Dynamic Worker Node
+Protected
create+- create
And Setup Dynamic Worker Node(): number
+-
+
-
Creates a new, completely set up dynamic worker node.
Returns number
The worker node key
+Returns number
New, completely set up dynamic worker node key.
And Setup Worker
+Protected
createProtected
create-- create
And Setup Worker(): Worker
+- create
And Setup Worker Node(): number
-
-
-- Defined in src/pools/abstract-pool.ts:1061
Worker
- create
Worker(): Worker
-
-
-- Defined in src/pools/abstract-pool.ts:1054
Task
+- Defined in src/pools/abstract-pool.ts:1483
- destroy(): Promise<void>
-
-
-- Defined in src/pools/abstract-pool.ts:803
+
+ Worker Node
-
-
\ No newline at end of file
+
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.
+Protected
Abstract
createReturns a newly created worker.
+Creates a new worker.
Returns Worker
+Returns Worker
Newly created worker.
+ +Private
dequeue@@ -532,63 +711,63 @@ Can be overridden.
workerNodeKey: number
Returns undefined | Task<Data>
destroy
Shutdowns every current worker in this pool.
+Terminates all workers in this pool.
Returns Promise<void>
- Worker
+Protected
Abstract
destroyProtected
Abstract
destroy-- destroy
Worker(worker): void | Promise<void>
+- destroy
Worker Node(workerNodeKey): Promise<void>
-
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:834
- enable
Tasks Queue(enable, tasksQueueOptions?): void
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:643
Task
+- Defined in src/pools/abstract-pool.ts:1477
-
-
+
+- flush
Tasks Queue(workerNodeKey): void
-
@@ -657,7 +850,7 @@ Can be overridden.
+- Defined in src/pools/abstract-pool.ts:1491
Tasks Queues
-
-- Defined in src/pools/abstract-pool.ts:1501
+
+
+
+ Worker Node Key By Worker
-- Defined in src/pools/abstract-pool.ts:591
+
+
+
+
+
+
+
+
+
+
Busy
- internal
Busy(): boolean
-
-
+- Defined in src/pools/abstract-pool.ts:705
Main
-
-
+
+
+- Defined in src/pools/abstract-pool.ts:1202
Worker Message Listener
+- Defined in src/pools/abstract-pool.ts:1149
Worker Node
+- Defined in src/pools/abstract-pool.ts:1440
+
+
+
+
+
+
To Worker
+
Shutdowns 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 void | Promise<void>
+Returns Promise<void>
enable Tasks Queue
Enables/disables the worker tasks queue in this pool.
+Enables/disables the worker node tasks queue in this pool.
Parameters
enable: boolean
-Whether to enable or disable the worker tasks queue.
+Whether to enable or disable the worker node tasks queue.
-Optional
tasksQueueOptions: TasksQueueOptionsThe worker tasks queue options.
+The worker node tasks queue options.
Returns void
Private
enqueue@@ -603,11 +782,11 @@ Can be overridden.
task: Task<Data>
Returns number
execute
-- execute(data?, name?): Promise<Response>
+- execute(data?, name?, transferList?): Promise<Response>
-
@@ -616,12 +795,17 @@ Can be overridden.
-
-
+
+-
+
+- Defined in src/pools/abstract-pool.ts:747
Task
- execute
Task(workerNodeKey, task): void
-
+
-
-
+
+
-
-
-
+
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.
+The optional 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 optional name of the task function to execute. If not specified, the default task function will be executed.
+
+Optional
transferList: TransferListItem[]An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the pool's worker_threads worker and they should not be used in the main thread afterwards.
Returns Promise<Response>
Promise that will be fulfilled when the task is completed.
@@ -629,25 +813,34 @@ Can be overridden.Private
executeExecutes the given task on the worker given its worker node key.
+Parameters
workerNodeKey: number
workerNodeKey: number
+The worker node key.
+task: Task<Data>
Returns void
Returns void
+ Tasks Queue
-Private
flush+- Defined in src/pools/abstract-pool.ts:1471
Tasks Queue
+Protected
flushworkerNodeKey: number
Returns void
Private
flush@@ -665,11 +858,31 @@ Can be overridden.-
Returns void
Worker Node Key
+Private
get Worker Info
+Protected
get+- get
Worker Info(workerNodeKey): WorkerInfo
+-
+
+
+
+
Gets the worker information given its worker node key.
+Parameters
++-
+
+
workerNodeKey: number
+The worker node key.
+Returns WorkerInfo
The worker information.
+ +Private
get-- get
Worker Node Key(worker): number
+- get
Worker Node Key By Worker(worker): number
-
@@ -681,19 +894,98 @@ Can be overridden.
Gets the given worker its worker node key.
The worker.
Returns number
The worker node key if the worker is found in the pool worker nodes,
+-1
otherwise.Returns number
The worker node key if found in the pool worker nodes,
+-1
otherwise. Worker Node Key By Worker Id
+Private
get+- get
Worker Node Key By Worker Id(workerId): number
+-
+
+
+
+
Gets the worker node key given its worker id.
+Parameters
++-
+
+
workerId: number
+The worker id.
+Returns number
The worker node key if the worker id is found in the pool worker nodes,
+ +-1
otherwise. Task Execution Response
+Private
handle+- handle
Task Execution Response(message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Response, unknown>
Returns void
Worker Ready Response
+Private
handle+- handle
Worker Ready Response(message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Response, unknown>
Returns void
Back Pressure
+Private
has+- has
Back Pressure(): boolean
+-
+
Returns boolean
has Worker Node Back Pressure
++- has
Worker Node Back Pressure(workerNodeKey): boolean
+
+
+
+
Internal
+Whether the worker node has back pressure (i.e. its tasks queue is full).
+Parameters
++-
+
+
workerNodeKey: number
+The worker node key.
+Returns boolean
+ +true
if the worker node has back pressure,false
otherwise.Protected
internalReturns boolean
Protected
Abstract
is@@ -704,33 +996,39 @@ Can be overridden.
Returns boolean
-- Defined in src/pools/abstract-pool.ts:445
Worker Node
-Private
push-- push
Worker Node(worker): number
+- Defined in src/pools/abstract-pool.ts:849
list Task Functions
++- list
Task Functions(): string[]
-
-
+
+
+
+
+
Pushes the given worker in the pool worker nodes.
+Lists the names of task function available in this pool.
Returns string[]
The names of task function available in this pool.
+ +Implementation of IPool.listTaskFunctions
++- Defined in src/pools/abstract-pool.ts:726
Queued Tasks
+Private
redistribute+- redistribute
Queued Tasks(workerNodeKey): void
+-
-
-
-
-
+
Parameters
worker: Worker
-The worker.
-Returns number
The worker nodes length.
- -workerNodeKey: number
Returns void
-- Defined in src/pools/abstract-pool.ts:693
Protected
Abstract
register-- register
Worker Message Listener<Message>(worker, listener): void
+- register
Worker Message Listener<Message>(workerNodeKey, listener): void
-
-
-
-
-
@@ -759,12 +1057,12 @@ Can be overridden.
-
-
+
Registers a listener callback on the given worker.
+Registers a listener callback on the worker given its worker node key.
Type Parameters
@@ -741,8 +1039,8 @@ Can be overridden.Parameters
worker: Worker
-The worker which should register a listener.
+workerNodeKey: number
+The worker node key.
Parameters
message: MessageValue<Message, Worker | MessagePort>
message: MessageValue<Message, unknown>
Returns void
Returns void
-- Defined in src/pools/abstract-pool.ts:573
Private
remove@@ -783,51 +1081,122 @@ Can be overridden.
Returns void
-- Defined in src/pools/abstract-pool.ts:739
Kill Message To Worker
+Protected
send+- send
Kill Message To Worker(workerNodeKey, workerId): Promise<void>
+-
+
+
+
+
Parameters
++-
+
+-
+
workerNodeKey: number
workerId: number
Returns Promise<void>
+- Defined in src/pools/abstract-pool.ts:813
Startup Message To Worker
+Protected
Abstract
send+- send
Startup Message To Worker(workerNodeKey): void
+-
+
+
+
+
+
Sends the startup message to worker given its worker node key.
+Parameters
++-
+
+
workerNodeKey: number
+The worker node key.
+Returns void
++- Defined in src/pools/abstract-pool.ts:1182
Statistics Message To Worker
+Private
send+- send
Statistics Message To Worker(workerNodeKey): void
+-
+
+
+
+
+
Sends the statistics message to worker given its worker node key.
+Parameters
++-
+
+
workerNodeKey: number
+The worker node key.
+Returns void
++- Defined in src/pools/abstract-pool.ts:1189
Protected
Abstract
send-- send
To Worker(worker, message): void
+- send
To Worker(workerNodeKey, message, transferList?): void
-
-
-
-
-
-
+
+-
+
+- Defined in src/pools/abstract-pool.ts:1043
- set
Tasks Queue Options(tasksQueueOptions): void
-
-
-
+- Defined in src/pools/abstract-pool.ts:655
+
+
+- Defined in src/pools/abstract-pool.ts:610
-
-- Defined in src/pools/abstract-pool.ts:629
+
+
+
+ Create Dynamic Worker
-
-- Defined in src/pools/abstract-pool.ts:738
+
+ Update Task Function Worker Usage
-
-- Defined in src/pools/abstract-pool.ts:948
+
+ Task Statistics Worker Usage
+
+
+
+
+
+
+- Defined in src/pools/abstract-pool.ts:962
Listener
- worker
Listener(): ((message) => void)
-
-
- (message): void
-
-
-
-
+
+ - Defined in src/pools/abstract-pool.ts:1321
+
+
+
+
-
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.
message: MessageValue<Data, Worker | MessagePort>
+message: MessageValue<Data, unknown>
The message.
+Optional
transferList: TransferListItem[]The optional array of transferable objects.
+Returns void
-- Defined in src/pools/abstract-pool.ts:562
set Tasks Queue Options
Sets the worker tasks queue options in this pool.
+Sets the worker node tasks queue options in this pool.
Parameters
tasksQueueOptions: TasksQueueOptions
-The worker tasks queue options.
+The worker node tasks queue options.
Returns void
Implementation of IPool.setTasksQueueOptions
-- Defined in src/pools/abstract-pool.ts:337
Tasks Queue Size
+Private
set+- set
Tasks Queue Size(size): void
+-
+
+
+
+
Parameters
++-
+
size: number
Returns void
+- Defined in src/pools/abstract-pool.ts:666
set Worker Choice Strategy
@@ -839,7 +1208,7 @@ Can be overridden.-
-
@@ -852,7 +1221,7 @@ Can be overridden.
Parameters
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
+workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
The worker choice strategy.
Implementation of IPool.setWorkerChoiceStrategy
-- Defined in src/pools/abstract-pool.ts:284
set Worker Choice Strategy Options
@@ -872,77 +1241,85 @@ Can be overridden.
Implementation of IPool.setWorkerChoiceStrategyOptions
-- Defined in src/pools/abstract-pool.ts:314
Worker Node
+Private
set Hook
+Protected
setup+- setup
Hook(): void
+-
+
+
+
Setup hook to execute code before worker nodes are created in the abstract constructor. +Can be overridden.
+Returns void
++- Defined in src/pools/abstract-pool.ts:842
Private
shall-- set
Worker Node(workerNodeKey, worker, tasksUsage, tasksQueue): void
+- shall
Create Dynamic Worker(): boolean
-
-
+
+
+
+
+
Sets the given worker in the pool worker nodes.
+Conditions for dynamic worker creation.
Returns boolean
Whether to create a dynamic worker or not.
+ ++- Defined in src/pools/abstract-pool.ts:1032
Execute Task
+Private
shall+- shall
Execute Task(workerNodeKey): boolean
+-
-
-
-
--
-
-
--
-
-
--
-
-
-
+
Parameters
workerNodeKey: number
-The worker node key.
-worker: Worker
-The worker.
-tasksUsage: TasksUsage
-The worker tasks usage.
-tasksQueue: Queue<Task<Data>>
-The worker task queue.
-Returns void
-workerNodeKey: number
Returns boolean
-- Defined in src/pools/abstract-pool.ts:721
Worker Node Tasks Usage
+Private
setPrivate
shall-- set
Worker Node Tasks Usage(workerNode, tasksUsage): void
+- shall
Update Task Function Worker Usage(workerNodeKey): boolean
-
-
-
-
-
--
-
-
-
-
+
+
+- Defined in src/pools/abstract-pool.ts:337
+
+
Queue Size
-
-- Defined in src/pools/abstract-pool.ts:1487
+
+
+
+
+
+ Run Time Worker Usage
Sets the given worker node its tasks usage in the pool.
+Whether the worker node shall update its task function worker usage or not.
Parameters
workerNode: WorkerNode<Worker, Data>
-The worker node.
-tasksUsage: TasksUsage
-The worker node tasks usage.
+workerNodeKey: number
+The worker node key.
Returns void
+Returns boolean
+true
if the worker node shall update its task function worker usage,false
otherwise.-- Defined in src/pools/abstract-pool.ts:680
Hook
-Protected
setup-- setup
Hook(): void
+- Defined in src/pools/abstract-pool.ts:921
Pool
+Private
start+- start
Pool(): void
-
-
-
+
Setup hook to execute code before worker node are created in the abstract constructor. -Can be overridden
-Returns void
-Returns void
-- Defined in src/pools/abstract-pool.ts:438
Stealing On Empty Queue
+Private
task+- task
Stealing On Empty Queue(workerId): void
+-
+
+
+
+
Parameters
++-
+
workerId: number
Returns void
+- Defined in src/pools/abstract-pool.ts:1246
Private
tasks@@ -955,43 +1332,101 @@ Can be overridden
workerNodeKey: number
Returns number
-- Defined in src/pools/abstract-pool.ts:760
Run Time Tasks Usage
+Private
update Stealing On Back Pressure
+Private
tasks+- tasks
Stealing On Back Pressure(workerId): void
+-
+
+
+
+
Parameters
++-
+
workerId: number
Returns void
+- Defined in src/pools/abstract-pool.ts:1278
Elu Worker Usage
+Private
update+- update
Elu Worker Usage(workerUsage, message): void
+-
+
+
+
+
Parameters
++-
+
+-
+
workerUsage: WorkerUsage
message: MessageValue<Response, unknown>
Returns void
+- Defined in src/pools/abstract-pool.ts:975
Private
update-- update
Run Time Tasks Usage(workerTasksUsage, message): void
+- update
Run Time Worker Usage(workerUsage, message): void
-
-
-
+-
-
+
Parameters
workerTasksUsage: TasksUsage
workerUsage: WorkerUsage
message: MessageValue<Response, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
-- Defined in src/pools/abstract-pool.ts:479
Wait Time Tasks Usage
+Private
updatePrivate
update-- update
Wait Time Tasks Usage(workerTasksUsage, message): void
+- update
Task Statistics Worker Usage(workerUsage, message): void
-
-
-
+-
-
+
Parameters
workerTasksUsage: TasksUsage
workerUsage: WorkerUsage
message: MessageValue<Response, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
+- Defined in src/pools/abstract-pool.ts:930
Task Stolen Statistics Worker Usage
+Private
update+- update
Task Stolen Statistics Worker Usage(workerNodeKey, taskName): void
+-
+
+
+
+
Parameters
++-
+
+-
+
workerNodeKey: number
taskName: string
Returns void
+- Defined in src/pools/abstract-pool.ts:1227
Wait Time Worker Usage
+Private
update+- update
Wait Time Worker Usage(workerUsage, task): void
+-
+
+
Parameters
++-
+
+-
+
workerUsage: WorkerUsage
task: Task<Data>
Returns void
-- Defined in src/pools/abstract-pool.ts:502
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.
@@ -1000,32 +1435,32 @@ Can be overriddenThis function is the listener registered for each worker message.
+This method is the listener registered for each worker message.
Parameters
message: MessageValue<Response, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
The listener function to execute when a message is received from a worker.
-- Defined in src/pools/abstract-pool.ts:629
-
+Settings
Settings
Member Visibility
Theme
@@ -1035,9 +1470,13 @@ Can be overridden- constructor
- emitter
- file
Path
+- max
- number
Of Workers
- opts
- promise
Response Map
+- start
Timestamp
+- started
+- starting
- worker
Choice Strategy Context
- worker
Nodes
- busy
@@ -1045,98 +1484,99 @@ Can be overridden
- info
- max
Size
- min
Size
+- ready
- type
+- utilization
- worker
+- add
Worker Node
- after
Task Execution Hook
-- after
Worker Setup
+- after
Worker Node Setup
- before
Task Execution Hook
- build
Tasks Queue Options
-- check
And Emit Events
+- check
And Emit Dynamic Worker Creation Events
+- check
And Emit Task Execution Events
+- check
And Emit Task Queuing Events
+- check
Dynamic Pool Size
- check
File Path
+- check
Message Worker Id
- check
Number Of Workers
- check
Pool Options
- check
Valid Tasks Queue Options
- check
Valid Worker Choice Strategy
- check
Valid Worker Choice Strategy Options
-- choose
Worker Node
-- create
And Setup Worker
+- choose
Worker Node
+- create
And Setup Dynamic Worker Node
+- create
And Setup Worker Node
- create
Worker
- dequeue
Task
- destroy
-- destroy
Worker
+- destroy
Worker Node
- enable
Tasks Queue
- enqueue
Task
- execute
- execute
Task
-- flush
Tasks Queue
+- flush
Tasks Queue
- flush
Tasks Queues
-- get
Worker Node Key
+- get
Worker Info
+- get
Worker Node Key By Worker
+- get
Worker Node Key By Worker Id
+- handle
Task Execution Response
+- handle
Worker Ready Response
+- has
Back Pressure
+- has
Worker Node Back Pressure
- internal
Busy
- is
Main
-- push
Worker Node
+- list
Task Functions
+- redistribute
Queued Tasks
- register
Worker Message Listener
- remove
Worker Node
+- send
Kill Message To Worker
+- send
Startup Message To Worker
+- send
Statistics Message To Worker
- send
To Worker
- set
Tasks Queue Options
+- set
Tasks Queue Size
- set
Worker Choice Strategy
- set
Worker Choice Strategy Options
-- set
Worker Node
-- set
Worker Node Tasks Usage
- setup
Hook
+- shall
Create Dynamic Worker
+- shall
Execute Task
+- shall
Update Task Function Worker Usage
+- start
Pool
+- task
Stealing On Empty Queue
- tasks
Queue Size
-- update
Run Time Tasks Usage
-- update
Wait Time Tasks Usage
+- tasks
Stealing On Back Pressure
+- update
Elu Worker Usage
+- update
Run Time Worker Usage
+- update
Task Statistics Worker Usage
+- update
Task Stolen Statistics Worker Usage
+- update
Wait Time Worker Usage
- worker
Listener
Generated using TypeDoc
Generated using TypeDoc