X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=75f41dbfacfc286e76e82cd0faf227fc2fa63e22;hb=d5d8ef5b0645ff2e43010f981a768c48cd559854;hp=18916b7778b71162206b270641a5d18659a9594e;hpb=6d59ea2c71b8a88d41498c6fb54dfad95fd3a3ac;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 18916b77..75f41dbf 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -17,7 +17,6 @@
A thread pool with a fixed number of threads.
-It is possible to perform tasks in sync or asynchronous mode as you prefer.
Author
Alessandro Pio Ardizio
@@ -29,24 +28,24 @@Data = unknown
-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.
Hierarchy
-- AbstractPool<ThreadWorkerWithMessageChannel, Data, Response>
+
- AbstractPool<Worker, Data, Response>
- FixedThreadPool
- DynamicThreadPool
@@ -79,7 +78,7 @@
after Task Execution Hook
-after Worker Setup
+after Worker Setup
before Task Execution Hook
create And Setup Dynamic Worker
create And Setup Worker
@@ -90,7 +89,6 @@
execute
internal Busy
is Main
-register Worker Message Listener
send To Worker
set Tasks Queue Options
set Worker Choice Strategy
@@ -136,7 +134,7 @@
+- Defined in src/pools/thread/fixed.ts:48
@@ -154,7 +152,7 @@
+- Defined in src/pools/abstract-pool.ts:55
Path
file Path: string
@@ -163,7 +161,7 @@
+- Defined in src/pools/abstract-pool.ts:88
Of Workers
number Of Workers: number
@@ -172,7 +170,7 @@
+- Defined in src/pools/abstract-pool.ts:87
opts: ThreadPoolOptions = {}
@@ -181,10 +179,10 @@
+- Defined in src/pools/thread/fixed.ts:51
promise Response Map: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
+promise Response Map: Map<string, PromiseResponseWrapper<Worker, Response>> = ...
@@ -195,25 +193,25 @@
+- Defined in src/pools/abstract-pool.ts:65
worker Choice Strategy Context: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>
+worker Choice Strategy Context: WorkerChoiceStrategyContext<Worker, Data, Response>
+- Defined in src/pools/abstract-pool.ts:73
worker Nodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
+worker Nodes: WorkerNode<Worker, Data>[] = []
+- Defined in src/pools/abstract-pool.ts:52
@@ -228,7 +226,7 @@
+- Defined in src/pools/thread/fixed.ts:101
+- Defined in src/pools/abstract-pool.ts:392
+- Defined in src/pools/abstract-pool.ts:240
Size
+- Defined in src/pools/thread/fixed.ts:96
Size
+- Defined in src/pools/thread/fixed.ts:91
+- Defined in src/pools/thread/fixed.ts:81
+- Defined in src/pools/thread/fixed.ts:86
@@ -317,12 +315,12 @@ Can be overridden.
-
-
-
-
@@ -330,28 +328,28 @@ Can be overridden.
-
+- Defined in src/pools/abstract-pool.ts:506
+
+- 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
+
Methods
Properties
Protected
Readonly
fileProtected
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.
Nodes
-Readonly
workerPool worker nodes.
Accessors
Protected
full@@ -241,7 +239,7 @@
info
@@ -253,7 +251,7 @@
Protected
max@@ -265,7 +263,7 @@
Protected
min@@ -277,7 +275,7 @@
Protected
type@@ -290,7 +288,7 @@
Protected
worker@@ -302,7 +300,7 @@
Methods
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
The worker.
message: MessageValue<Response, unknown, Worker | MessagePort>
+message: MessageValue<Response, unknown>
The received message.
Worker Setup
-Protected
after+- after
Worker Setup(worker): void
-
-
-
-
- Defined in src/pools/abstract-pool.ts:699
Task Execution Hook
+- Defined in src/pools/abstract-pool.ts:490
And Setup Dynamic Worker
+- Defined in src/pools/abstract-pool.ts:742
And Setup Worker
+- Defined in src/pools/abstract-pool.ts:709
Worker
+- Defined in src/pools/thread/fixed.ts:73
+- Defined in src/pools/abstract-pool.ts:451
Worker
@@ -448,7 +446,7 @@ Can be overridden.
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.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.
Returns void
+Protected
before@@ -377,46 +375,46 @@ Can be overridden.
Protected
create-- create
And Setup Dynamic Worker(): ThreadWorkerWithMessageChannel
+- create
And Setup Dynamic Worker(): Worker
-
-
Creates a new dynamic worker and sets it up completely in the pool worker nodes.
Returns ThreadWorkerWithMessageChannel
New, completely set up dynamic worker.
+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
-
-
Creates a new worker.
Returns ThreadWorkerWithMessageChannel
Newly created worker.
+Returns Worker
Newly created worker.
destroy
@@ -428,7 +426,7 @@ Can be overridden.
Protected
destroy@@ -440,7 +438,7 @@ Can be overridden.-
-
Parameters
worker: ThreadWorkerWithMessageChannel
+worker: Worker
A worker within
workerNodes
.enable Tasks Queue
@@ -473,7 +471,7 @@ Can be overridden.
execute
@@ -486,7 +484,7 @@ Can be overridden.-
-
@@ -499,7 +497,7 @@ Can be overridden.
+- Defined in src/pools/abstract-pool.ts:417
Busy
+- Defined in src/pools/abstract-pool.ts:408
Main
-
-
+- Defined in src/pools/thread/fixed.ts:57
To Worker
@@ -590,7 +547,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
internal@@ -512,7 +510,7 @@ Can be overridden.
Protected
is@@ -524,48 +522,7 @@ Can be overridden.
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
-Protected
send@@ -577,12 +534,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.
set Tasks Queue Options
@@ -610,7 +567,7 @@ Can be overridden.
set Worker Choice Strategy
@@ -635,7 +592,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -655,20 +612,20 @@ Can be overridden.
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
+Protected
worker@@ -689,14 +646,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.