X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FAbstractPool.html;h=57b75a1a6da1adfb6f25fa46a5518a8e1ce7ed62;hb=4ee786575c19cfc95faa0dfc2671b3ab8f680402;hp=7806afafcb178b8bbc6d42415b006abc25d90b0a;hpb=aba8d9bd41f1bd46f3cc3863c0c2e74bdfacb7b6;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index 7806afaf..57b75a1a 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
-Optional
Readonly
emitterEmitter on which events can be listened to.
+
+Optional
emitterEvent emitter integrated with async resource on which events can be listened to. +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.'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
startingWhether the pool is starting or not.
+ Functions
+Private
Readonly
taskThe task functions added at runtime map:
++
+
+
+key
: The task function name.value
: The task function itself.Protected
worker Nodes
-Readonly
worker Nodes
+Readonly
Internal
workerPool worker nodes.
Accessors
Returns boolean
Protected
full@@ -265,7 +348,7 @@
Returns boolean
info
@@ -277,58 +360,134 @@
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:472
+
+
+
Task Execution Hook
-
-- Defined in src/pools/abstract-pool.ts:170
+
+ Pool Options
Gets the worker type.
+The worker type.
Returns "cluster" | "thread"
+Returns "thread" | "cluster"
+Methods
+add Task Function
++- add
Task Function(name, fn): Promise<boolean>
+-
+
+
+
+
+
Adds a task function to this pool. +If a task function with the same name already exists, it will be overwritten.
+Parameters
++-
+
+
+-
+
+
name: string
+The name of the task function.
+fn: TaskFunction<Data, Response>
+The task function.
+Returns Promise<boolean>
+ +true
if the task function was added,false
otherwise.Throws
https://nodejs.org/api/errors.html#class-typeerror If the
+ +name
parameter is not a string or an empty string.Throws
https://nodejs.org/api/errors.html#class-typeerror If the
+fn
parameter is not a function. 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:1033
+
+ Worker Node Setup
-
-- Defined in src/pools/abstract-pool.ts:494
+
+ Number Of Workers
Hook executed after the worker task execution. Can be overridden.
@@ -337,39 +496,39 @@ Can be overridden.Parameters
worker: Worker
-The worker.
+workerNodeKey: number
+The worker node key.
message: MessageValue<Response, unknown, 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:1344
Task Execution Hook
+- Defined in src/pools/abstract-pool.ts:1003
Tasks Queue Options
-- Defined in src/pools/abstract-pool.ts:600
+
+ And Emit Dynamic Worker Creation Events
-
-- Defined in src/pools/abstract-pool.ts:1568
+
+ And Emit Task Execution Events
-
-- Defined in src/pools/abstract-pool.ts:1556
+
+ And Emit Task Queuing Events
-
-- Defined in src/pools/abstract-pool.ts:1562
+
+ Message Worker Id
+
+
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@@ -394,7 +553,7 @@ Can be overridden.
Returns void
Private
build@@ -407,80 +566,78 @@ 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
File Path
+Private
checkPrivate
check-- check
File Path(filePath): void
+- check
And Emit Task Execution Events(): void
-
-
-
Parameters
---
-
filePath: string
Returns void
Number Of Workers
+Private
checkPrivate
check-- check
Number Of Workers(numberOfWorkers): void
+- check
And Emit Task Queuing Events(): void
-
-
-
Parameters
---
-
numberOfWorkers: number
Returns void
Pool Options
+Private
checkPrivate
check-- check
Pool Options(opts): void
+- check
Message Worker Id(message): void
-
+
-
-
-
Checks if the worker id sent in the received message from a worker is valid.
+Parameters
opts: PoolOptions<Worker>
Returns void
Returns void
+Throws
https://nodejs.org/api/errors.html#class-error If the worker id is invalid.
+ Valid Tasks Queue Options
+Private
checkPrivate
check-- check
Valid Tasks Queue Options(tasksQueueOptions): void
+- check
Number Of Workers(numberOfWorkers): void
-
-
-
+
Parameters
tasksQueueOptions: TasksQueueOptions
numberOfWorkers: number
Returns void
Valid Worker Choice Strategy
+Private
checkPrivate
check-- check
Valid Worker Choice Strategy(workerChoiceStrategy): void
+- check
Pool Options(opts): void
-
-
-
+
Parameters
workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"
opts: PoolOptions<Worker>
Returns void
Private
check@@ -493,7 +650,7 @@ Can be overridden.
workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
Returns void
Private
choose@@ -502,35 +659,35 @@ Can be overridden.
-
Chooses a worker node for the next task.
The default worker choice strategy uses a round robin algorithm to distribute the tasks.
Returns number
The worker node key
+Returns number
The chosen worker node key
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:1250
+
+ And Setup Worker Node
+- Defined in src/pools/abstract-pool.ts:1658
+
+
- destroy(): Promise<void>
-
-
-- Defined in src/pools/abstract-pool.ts:940
+
+ Worker Node
+
+
+
+
+- Defined in src/pools/abstract-pool.ts:1411
Wait Time Worker Usage
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.
- And Setup Worker
+Protected
createProtected
create-- create
And Setup Worker(): Worker
+- create
And Setup Worker Node(): number
-
-
-- Defined in src/pools/abstract-pool.ts:1206
Worker
+- Defined in src/pools/abstract-pool.ts:1199
+
+
Task
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
create@@ -542,7 +699,20 @@ Can be overridden.
Task Function Worker Usages
+Private
delete+- delete
Task Function Worker Usages(name): void
+-
+
+
+
Parameters
++-
+
name: string
Returns void
Private
dequeue@@ -555,63 +725,103 @@ Can be overridden.
workerNodeKey: number
Returns undefined | Task<Data>
Worker Message Listener
+Protected
Abstract
deregister+- deregister
Worker Message Listener<Message>(workerNodeKey, listener): void
+-
+
+
+
+
+
+
Deregisters a listener callback on the worker given its worker node key.
+Type Parameters
++-
+
Message
Parameters
++-
+
+
+-
+
+
+
workerNodeKey: number
+The worker node key.
+listener: ((message) => void)
+The message listener callback.
++-
+
+- (message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Message, unknown>
Returns void
Returns void
+destroy
Terminate 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:979
- enable
Tasks Queue(enable, tasksQueueOptions?): void
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:565
Task
+- Defined in src/pools/abstract-pool.ts:1652
-
-
+
+- flush
Tasks Queue(workerNodeKey): void
-
@@ -680,7 +904,7 @@ Can be overridden.
+- Defined in src/pools/abstract-pool.ts:1666
Tasks Queues
-
-
+
+
+
-- Defined in src/pools/abstract-pool.ts:1582
+
+ Worker Node Key By Worker
-
-
-- Defined in src/pools/abstract-pool.ts:513
+
+ Worker Node Key By Worker Id
+
+
+
+
+
+
+
+
+
+
+
+
+- Defined in src/pools/abstract-pool.ts:264
Busy
- internal
Busy(): boolean
-
-
- Defined in src/pools/abstract-pool.ts:667
Main
-
-- Defined in src/pools/abstract-pool.ts:994
+
+
+
+ Queued Tasks
+- Defined in src/pools/abstract-pool.ts:1305
+
+
Worker Node
+- Defined in src/pools/abstract-pool.ts:1615
+
+
+
+
+
+
+
+
+
+
To Worker
+- Defined in src/pools/abstract-pool.ts:1093
Task Statistics Worker Usage
+
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 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@@ -626,11 +836,11 @@ Can be overridden.
task: Task<Data>
Returns number
execute
-- execute(data?, name?): Promise<Response>
+- execute(data?, name?, transferList?): Promise<Response>
-
@@ -639,12 +849,17 @@ Can be overridden.
-
-
+
+-
+
+- Defined in src/pools/abstract-pool.ts:870
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.
@@ -652,25 +867,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:1646
Tasks Queue
+Protected
flushworkerNodeKey: number
Returns void
Private
flush@@ -688,24 +912,31 @@ Can be overridden.-
Returns void
Task Statistics
-Private
get-- get
Task Statistics(worker): TaskStatistics
+- Defined in src/pools/abstract-pool.ts:1676
Worker Info
+Protected
get+- get
Worker Info(workerNodeKey): WorkerInfo
-
+
-
-
-
Gets the worker information given its worker node key.
+Parameters
worker: Worker
Returns TaskStatistics
Returns WorkerInfo
The worker information.
+ + - Worker Node Key
+Private
getPrivate
get-- get
Worker Node Key(worker): number
+- get
Worker Node Key By Worker(worker): number
-
@@ -717,36 +948,127 @@ 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 Usage
+Private
getPrivate
get-- get
Worker Usage(worker): WorkerUsage
+- get
Worker Node Key By Worker Id(workerId): number
-
+
-
-
-
Gets the worker node key given its worker id.
+Parameters
worker: Worker
Returns WorkerUsage
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 Task Function
++- has
Task Function(name): boolean
+-
+
+
+
+
Whether the specified task function exists in this pool.
+Parameters
++-
+
+
name: string
+The name of the task function.
+Returns boolean
+ +true
if the task function exists,false
otherwise.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. Event Emitter
+Private
initialize+- initialize
Event Emitter(): void
+-
+
Returns void
Protected
internalWhether worker nodes are executing at least one task.
+Whether worker nodes are executing concurrently their tasks quota or not.
Returns boolean
Worker nodes busyness boolean status.
+Protected
Abstract
is@@ -757,33 +1079,79 @@ Can be overridden.
Returns boolean
Worker Node
+Private
pushlist Task Function Names
++- list
Task Function Names(): string[]
+-
+
+
Lists the names of task function available in this pool.
+Returns string[]
The names of task function available in this pool.
+ +Private
redistribute-- push
Worker Node(worker): number
+- redistribute
Queued Tasks(workerNodeKey): void
-
-
+
+
+
+- Defined in src/pools/abstract-pool.ts:1318
Worker Message Listener
Pushes the given worker in the pool worker nodes.
+Parameters
++-
+
workerNodeKey: number
Returns void
+ Once Worker Message Listener
+Protected
Abstract
register+- register
Once Worker Message Listener<Message>(workerNodeKey, listener): void
+-
+
+
+
-
-
-
-
+-
+
+
+
+
Registers once a listener callback on the worker given its worker node key.
Type Parameters
++-
+
Message
Parameters
worker: Worker
-The worker.
+workerNodeKey: number
+The worker node key.
Returns number
The worker nodes length.
- +listener: ((message) => void)
+The message listener callback.
++-
+
+- (message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Message, unknown>
Returns void
Returns void
Protected
Abstract
register-- register
Worker Message Listener<Message>(worker, listener): void
+- register
Worker Message Listener<Message>(workerNodeKey, listener): void
-
-
-
-
-
@@ -812,12 +1180,33 @@ 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
@@ -794,8 +1162,8 @@ Can be overridden.Parameters
worker: Worker
-The worker which should register a listener.
+workerNodeKey: number
+The worker node key.
Parameters
message: MessageValue<Message, unknown, Worker | MessagePort>
message: MessageValue<Message, unknown>
Returns void
Returns void
remove Task Function
++- remove
Task Function(name): Promise<boolean>
+-
+
+
+
+
Removes a task function from this pool.
+Parameters
++-
+
+
name: string
+The name of the task function.
+Returns Promise<boolean>
+ +true
if the task function was removed,false
otherwise.Private
remove@@ -836,51 +1225,185 @@ Can be overridden.
Returns void
Kill Message To Worker
+Protected
send+- send
Kill Message To Worker(workerNodeKey): Promise<void>
+-
+
+
+
Parameters
++-
+
workerNodeKey: number
Returns Promise<void>
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
+ 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
+ Task Function Operation To Worker
+Private
send+- send
Task Function Operation To Worker(workerNodeKey, message): Promise<boolean>
+-
+
+
+
Parameters
++-
+
+-
+
workerNodeKey: number
message: MessageValue<Data, unknown>
Returns Promise<boolean>
Task Function Operation To Workers
+Private
send+- send
Task Function Operation To Workers(message): Promise<boolean>
+-
+
+
+
Parameters
++-
+
message: MessageValue<Data, unknown>
Returns Promise<boolean>
Protected
Abstract
send-- send
To Worker(worker, message): void
+- send
To Worker(workerNodeKey, message, transferList?): void
-
-
-
-
-
-
+
+-
+
+- Defined in src/pools/abstract-pool.ts:1188
+
+
+
+
- set
Tasks Queue Options(tasksQueueOptions): void
-
-
-
+- Defined in src/pools/abstract-pool.ts:579
+
+
+
+
+- Defined in src/pools/abstract-pool.ts:532
-
-- Defined in src/pools/abstract-pool.ts:551
+
+
+
+ Create Dynamic Worker
-
-- Defined in src/pools/abstract-pool.ts:861
+
+ Update Task Function Worker Usage
+
-
+
+
+- Defined in src/pools/abstract-pool.ts:1662
+
+
+
+
+
+
Elu Worker Usage
+
+- Defined in src/pools/abstract-pool.ts:1120
Run Time Worker Usage
+
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, unknown, Worker | MessagePort>
+message: MessageValue<Data, unknown>
The message.
+Optional
transferList: TransferListItem[]The optional array of transferable objects.
+Returns void
set Default Task Function
++- set
Default Task Function(name): Promise<boolean>
+-
+
+
+
+
Sets the default task function in this pool.
+Parameters
++-
+
+
name: string
+The name of the task function.
+Returns Promise<boolean>
+ +true
if the default task function was set,false
otherwise. Task Stealing
+Private
set+- set
Task Stealing(): void
+-
+
Returns void
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
Tasks Queue Size
+Private
set+- set
Tasks Queue Size(size): void
+-
+
+
+
Parameters
++-
+
size: number
Returns void
Tasks Stealing On Back Pressure
+Private
set+- set
Tasks Stealing On Back Pressure(): void
+-
+
Returns void
set Worker Choice Strategy
@@ -905,7 +1428,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -925,68 +1448,89 @@ Can be overridden.
Worker Node Tasks Usage
+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
+Private
shall-- set
Worker Node Tasks Usage(workerNode, workerUsage): void
+- shall
Create Dynamic Worker(): boolean
-
-
+
+
+
Sets the given worker node its tasks usage in the pool.
+Conditions for dynamic worker creation.
Returns boolean
Whether to create a dynamic worker or not.
+ + + Execute Task
+Private
shall+- shall
Execute Task(workerNodeKey): boolean
+-
-
-
-
--
-
-
-
Parameters
workerNode: WorkerNode<Worker, Data>
-The worker node.
-workerUsage: WorkerUsage
-The worker usage.
-Returns void
-Returns boolean
Worker Statistics
+Private
setPrivate
shall-- set
Worker Statistics(worker): void
+- shall
Update Task Function Worker Usage(workerNodeKey): boolean
-
+
-
-
-
Whether the worker node shall update its task function worker usage or not.
+Parameters
worker: Worker
Returns void
Returns boolean
+ + -true
if the worker node shall update its task function worker usage,false
otherwise. Hook
-Protected
setup-- setup
Hook(): void
+- Defined in src/pools/abstract-pool.ts:1066
start
++- start(): void
-
-
-- Defined in src/pools/abstract-pool.ts:924
+
+ Stealing On Empty Queue
+- Defined in src/pools/abstract-pool.ts:1430
Queue Size
Setup hook to execute code before worker node are created in the abstract constructor. -Can be overridden
+Starts the minimum number of workers in this pool.
Returns void
- Create Dynamic Worker
+Private
shallPrivate
task-- shall
Create Dynamic Worker(): boolean
+- task
Stealing On Empty Queue(workerId): void
-
-
-
Conditions for dynamic worker creation.
-Returns boolean
Whether to create a dynamic worker or not.
- -Private
tasks@@ -999,7 +1543,36 @@ Can be overridden
workerNodeKey: number
Returns number
-- Defined in src/pools/abstract-pool.ts:857
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:1458
Task Stealing
+Private
unset+- unset
Task Stealing(): void
+-
+
+
Returns void
+- Defined in src/pools/abstract-pool.ts:627
Tasks Stealing On Back Pressure
+Private
unset+- unset
Tasks Stealing On Back Pressure(): void
+-
+
+
Returns void
+- Defined in src/pools/abstract-pool.ts:640
Private
update@@ -1011,10 +1584,10 @@ Can be overridden-
-
-
workerUsage: WorkerUsage
message: MessageValue<Response, unknown, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
-- Defined in src/pools/abstract-pool.ts:569
Private
update@@ -1026,10 +1599,10 @@ Can be overridden-
-
-
workerUsage: WorkerUsage
message: MessageValue<Response, unknown, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
-- Defined in src/pools/abstract-pool.ts:509
Private
update@@ -1041,10 +1614,25 @@ Can be overridden-
-
-
workerUsage: WorkerUsage
message: MessageValue<Response, unknown, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
+- Defined in src/pools/abstract-pool.ts:1075
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:497
Private
update@@ -1059,39 +1647,28 @@ Can be overridden
task: Task<Data>
Returns void
-- Defined in src/pools/abstract-pool.ts:538
Listener
+Protected
workerProtected
worker-- worker
Listener(): ((message) => void)
--
-
-
This function is the listener registered for each worker message.
-Returns ((message) => void)
The listener function to execute when a message is received from a worker.
- ---
-
-- (message): void
+- worker
Message Listener(message): void
-
-
-
-
-
+
This function is the listener registered for each worker message.
+This method is the message listener registered on each worker.
Parameters
message: MessageValue<Response, unknown, Worker | MessagePort>
Returns void
The listener function to execute when a message is received from a worker.
- - +message: MessageValue<Response, unknown>
Returns void
-- Defined in src/pools/abstract-pool.ts:741
-
+Settings
Settings
Member Visibility