X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=cda827b9479c3fb3a538dc1ce44d0d9fd0ba40d6;hb=d5d8ef5b0645ff2e43010f981a768c48cd559854;hp=a1a2ae7db79542b0ffb46bdb780e8fc3665e3ed0;hpb=f05afd162e34836a52c48b05781750e3421424d8;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index a1a2ae7d..cda827b9 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -30,12 +30,12 @@ When the maximum number of threads is reached and workers are busy, an event is
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.
@@ -81,7 +81,7 @@ When the maximum number of threads is reached and workers are busy, an event isafter Task Execution Hook
after Worker Setup
before Task Execution Hook
-choose Worker Node
+create And Setup Dynamic Worker
create And Setup Worker
create Worker
destroy
@@ -90,7 +90,6 @@ When the maximum number of threads is reached and workers are busy, an event is
execute
internal Busy
is Main
-register Worker Message Listener
send To Worker
set Tasks Queue Options
set Worker Choice Strategy
@@ -141,7 +140,7 @@ When the maximum number of threads is reached and workers are busy, an event is
+- Defined in src/pools/thread/dynamic.ts:27
@@ -159,7 +158,7 @@ When the maximum number of threads is reached and workers are busy, an event is
+- Defined in src/pools/abstract-pool.ts:55
Path
file Path: string
@@ -168,7 +167,7 @@ When the maximum number of threads is reached and workers are busy, an event is
+- Defined in src/pools/abstract-pool.ts:88
max: number
@@ -176,7 +175,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Properties
Protected
Readonly
fileProtected
Readonly
maxProtected
Readonly
numberProtected
Readonly
opts Response Map
-Protected
promiseThe execution response promise map.
key
: The message id of each submitted task. Choice Strategy Context
-Protected
workerWorker choice strategy context referencing a worker choice algorithm implementation.
-Default to a round robin algorithm.
Nodes
-Readonly
workerPool worker nodes.
Accessors
Protected
full@@ -255,7 +253,7 @@ When the maximum number of threads is reached and workers are busy, an event is
info
@@ -267,7 +265,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Protected
max@@ -279,7 +277,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Protected
min@@ -291,7 +289,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Protected
type@@ -304,7 +302,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Protected
worker@@ -316,7 +314,7 @@ When the maximum number of threads is reached and workers are busy, an event is
Methods
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
The worker.
message: MessageValue<Response, unknown, Worker | MessagePort>
+message: MessageValue<Response, unknown>
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 themain-worker
<->worker
connection if not bind by default.Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes. +Can be overridden.
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
The newly created worker.
Protected
before@@ -391,70 +389,70 @@ Can be overridden.
Worker Node
+Protected
chooseProtected
create-- choose
Worker Node(): number
+- create
And Setup Dynamic Worker(): Worker
-
-
-- Defined in src/pools/abstract-pool.ts:742
And Setup Worker
+- Defined in src/pools/abstract-pool.ts:709
Worker
Chooses a worker node for the next task.
-The default worker choice strategy uses a round robin algorithm to distribute the load.
+Creates a new dynamic worker and sets it up completely in the pool worker nodes.
Returns number
The worker node key
+Returns Worker
New, completely set up dynamic worker.
+Protected
create-- create
And Setup Worker(): ThreadWorkerWithMessageChannel
+- create
And Setup Worker(): Worker
-
-
Creates a new worker and sets it up completely in the pool worker nodes.
Returns ThreadWorkerWithMessageChannel
New, completely set up worker.
+Returns Worker
New, completely set up worker.
Protected
create-- create
Worker(): ThreadWorkerWithMessageChannel
+- create
Worker(): Worker
-
-
-- Defined in src/pools/thread/fixed.ts:73
- destroy(): Promise<void>
-
-
- Defined in src/pools/abstract-pool.ts:451
Worker
- destroy
Worker(worker): Promise<void>
-
-
-
-
@@ -462,7 +460,7 @@ Can be overridden.
+- Defined in src/pools/thread/fixed.ts:62
+- Defined in src/pools/abstract-pool.ts:357
+- Defined in src/pools/thread/fixed.ts:68
+- Defined in src/pools/abstract-pool.ts:369
+- Defined in src/pools/abstract-pool.ts:324
+- Defined in src/pools/abstract-pool.ts:346
Hook
- setup
Hook(): void
-
-
+- Defined in src/pools/abstract-pool.ts:474
Listener
+
+ - Defined in src/pools/abstract-pool.ts:769
@@ -745,7 +706,7 @@ Can be overridden
- after
Task Execution Hook
- after
Worker Setup
- before
Task Execution Hook
-- choose
Worker Node
+- create
And Setup Dynamic Worker
- create
And Setup Worker
- create
Worker
- destroy
@@ -754,7 +715,6 @@ Can be overridden
- execute
- internal
Busy
- is
Main
-- register
Worker Message Listener
- send
To Worker
- set
Tasks Queue Options
- set
Worker Choice Strategy
@@ -788,6 +748,7 @@ Can be overridden
- Pool
Info
- Pool
Options
- Promise
Response Wrapper
+- Strategy
Policy
- Task
- Task
Error
- Task
Performance
@@ -800,8 +761,7 @@ Can be overridden
- Worker
Options
- Worker
Statistics
- Worker
Usage
-- Draft
-- Error
Handler
+- Error
Handler
- Exit
Handler
- Kill
Behavior
- Measurement
@@ -810,7 +770,6 @@ Can be overridden
- Pool
Event
- Pool
Type
- Task
Functions
-- Thread
Worker With Message Channel
- Worker
Async Function
- Worker
Choice Strategy
- Worker
Function
Returns a newly created worker.
+Creates a new worker.
Returns ThreadWorkerWithMessageChannel
+Returns Worker
Newly created worker.
+ +destroy
Shutdowns every current worker in this pool.
+Terminate every current worker in this pool.
Returns Promise<void>
+Protected
destroyShutdowns the given worker.
+Terminates the given worker.
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
A worker within
workerNodes
.enable Tasks Queue
@@ -487,7 +485,7 @@ Can be overridden.
execute
@@ -500,7 +498,7 @@ Can be overridden.-
-
@@ -513,16 +511,20 @@ Can be overridden.
+- Defined in src/pools/abstract-pool.ts:417
Busy
- internal
Busy(): boolean
-
-
+- Defined in src/pools/abstract-pool.ts:408
Main
-
-
+- Defined in src/pools/thread/fixed.ts:57
To Worker
@@ -600,7 +561,7 @@ Can be overridden.
-Optional
data: DataThe task input data for the specified worker function. This can only be serializable data.
+The task input data for the specified worker function. This can only be structured-cloneable data.
Protected
internalReturns boolean
Protected
is@@ -534,48 +536,7 @@ Can be overridden.
Inherited from FixedThreadPool.isMain
-- Defined in src/pools/thread/fixed.ts:67
Worker Message Listener
-Protected
register-- register
Worker Message Listener<Message>(worker, listener): void
--
-
-
-
-
-
-
-
Registers a listener callback on the given worker.
-Type Parameters
---
-
Message
Parameters
---
-
-
--
-
-
-
worker: ThreadWorkerWithMessageChannel
-The worker which should register a listener.
-listener: ((message) => void)
-The message listener callback.
---
-
-- (message): void
--
-
-
-
Parameters
---
-
message: MessageValue<Message, unknown, Worker | MessagePort>
Returns void
Returns void
-Inherited from FixedThreadPool.registerWorkerMessageListener
--- Defined in src/pools/thread/fixed.ts:88
Protected
send@@ -587,12 +548,12 @@ Can be overridden.-
-
-
-
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
The worker which should receive the message.
message: MessageValue<Data, unknown, Worker | MessagePort>
+message: MessageValue<Data, unknown>
The message.
Inherited from FixedThreadPool.sendToWorker
-- Defined in src/pools/thread/fixed.ts:80
set Tasks Queue Options
@@ -620,7 +581,7 @@ Can be overridden.
Inherited from FixedThreadPool.setTasksQueueOptions
-- Defined in src/pools/abstract-pool.ts:350
set Worker Choice Strategy
@@ -645,7 +606,7 @@ Can be overridden.
Inherited from FixedThreadPool.setWorkerChoiceStrategy
-- Defined in src/pools/abstract-pool.ts:305
set Worker Choice Strategy Options
@@ -665,20 +626,20 @@ Can be overridden.
Inherited from FixedThreadPool.setWorkerChoiceStrategyOptions
-- Defined in src/pools/abstract-pool.ts:327
Protected
setupSetup hook to execute code before worker node are created in the abstract constructor. -Can be overridden
+Setup hook to execute code before worker nodes are created in the abstract constructor. +Can be overridden.
Returns void
Inherited from FixedThreadPool.setupHook
-- Defined in src/pools/abstract-pool.ts:451
Protected
worker@@ -699,14 +660,14 @@ Can be overridden-
-
Parameters
message: MessageValue<Response, unknown, Worker | MessagePort>
message: MessageValue<Response, unknown>
Returns void
The listener function to execute when a message is received from a worker.
Inherited from FixedThreadPool.workerListener
-- Defined in src/pools/abstract-pool.ts:707