X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FFixedClusterPool.html;h=c39833d6f625df14008bc65e241d9920158dd3b4;hb=d99ba5a8a292772965b5027272a8dc677a6ad008;hp=3b7cbf107bac7fb7989306265abd165aa7685158;hpb=b08b5fc507f21848c9435380edb7d155e92eaaf5;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 3b7cbf10..c39833d6 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -6,7 +6,7 @@
Readonly
fileProtected
next
Id of the next message.
+Path to the worker-file.
Of Workers
-Readonly
number
-Readonly
optsOptions for this fixed cluster pool.
+Inherited from AbstractPool.opts
-- Defined in src/pools/cluster/fixed.ts:53
Map
-Protected
promiseThe promise map.
+ Response Map
+Protected
promiseThe promise response map.
-
-
+
+
-key
: This is the message Id of each submitted task.value
: An object that contains the worker, the resolve function and the reject function.key
: The message id of each submitted task.value
: An object that contains the worker, the promise resolve and reject callbacks.When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.
+When we receive a message from the worker we get a map entry with the promise resolve/reject bound to the message.
Inherited from AbstractPool.promiseMap
+Inherited from AbstractPool.promiseResponseMap
-- Defined in src/pools/abstract-pool.ts:50
Protected
workerWorker choice strategy instance implementing the worker choice algorithm.
-Default to a strategy implementing a round robin algorithm.
+Worker choice strategy context referencing a worker choice algorithm implementation.
+Default to a round robin algorithm.
Inherited from AbstractPool.workerChoiceStrategyContext
-- Defined in src/pools/abstract-pool.ts:65
-Readonly
workersInherit Doc
Inherited from AbstractPool.workers
-- Defined in src/pools/abstract-pool.ts:31
Tasks Usage
-Readonly
workersInherit Doc
Inherited from AbstractPool.workersTasksUsage
--- Defined in src/pools/abstract-pool.ts:34
Accessors
Returns boolean
Overrides AbstractPool.busy
-- Defined in src/pools/cluster/fixed.ts:104
number Of Running Tasks
--- get numberOfRunningTasks(): number
+- Defined in src/pools/cluster/fixed.ts:109
full
++- get full(): boolean
-
+
+
Inherit Doc
Returns boolean
Overrides AbstractPool.full
++- Defined in src/pools/cluster/fixed.ts:104
Of Running Tasks
+Private
number+- get numberOfRunningTasks(): number
+-
+
Number of tasks concurrently running in the pool.
+Returns number
Inherited from AbstractPool.numberOfRunningTasks
-- Defined in src/pools/abstract-pool.ts:151
type
@@ -240,13 +236,13 @@
Returns PoolType
Overrides AbstractPool.type
-- Defined in src/pools/cluster/fixed.ts:99
Methods
- Promise Worker Response Hook
+Protected
afterProtected
after-- after
Promise Worker Response Hook(message: MessageValue<Response, unknown>, promise: PromiseWorkerResponseWrapper<Worker, Response>): void
+- after
Promise Response Hook(worker: Worker, message: MessageValue<Response, unknown>): void
-
-
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:280
Worker Setup
-
-- Defined in src/pools/cluster/fixed.ts:93
+
+ Promise Response Hook
+- Defined in src/pools/abstract-pool.ts:178
Hook
+- Defined in src/pools/cluster/fixed.ts:59
Listener
+ - Defined in src/pools/abstract-pool.ts:384
Hook executed after the worker task promise resolution. Can be overridden.
@@ -255,17 +251,17 @@ Can be overridden.Parameters
message: MessageValue<Response, unknown>
-The received message.
+worker: Worker
+The worker.
promise: PromiseWorkerResponseWrapper<Worker, Response>
-The Promise response.
+message: MessageValue<Response, unknown>
+The received message.
Returns void
Inherited from AbstractPool.afterPromiseWorkerResponseHook
+Inherited from AbstractPool.afterPromiseResponseHook
-- Defined in src/pools/abstract-pool.ts:260
Protected
after@@ -281,11 +277,11 @@ Can be overridden.
Returns void
Overrides AbstractPool.afterWorkerSetup
-- Defined in src/pools/cluster/fixed.ts:93
Promise Worker Response Hook
+Protected
beforeProtected
before-- before
Promise Worker Response Hook(worker: Worker): void
+- before
Promise Response Hook(workerKey: number): void
-
-
-
-
+- Defined in src/pools/abstract-pool.ts:269
Worker
+- Defined in src/pools/abstract-pool.ts:309
And Setup Worker
+- Defined in src/pools/abstract-pool.ts:355
Worker
+- Defined in src/pools/cluster/fixed.ts:88
+- Defined in src/pools/abstract-pool.ts:233
+- Defined in src/pools/cluster/fixed.ts:69
-
-- Defined in src/pools/abstract-pool.ts:217
+
+
-
-
-
-
-
-
-
-
-
-- Defined in src/pools/abstract-pool.ts:210
+
+ Busy
+- Defined in src/pools/abstract-pool.ts:202
Main
+- Defined in src/pools/cluster/fixed.ts:64
+- Defined in src/pools/cluster/fixed.ts:80
Worker
+- Defined in src/pools/abstract-pool.ts:478
To Worker
+- Defined in src/pools/cluster/fixed.ts:75
+
Hook executed before the worker task promise resolution. Can be overridden.
@@ -294,27 +290,27 @@ Can be overridden.Parameters
worker: Worker
-The worker.
+workerKey: number
+The worker key.
Returns void
Inherited from AbstractPool.beforePromiseWorkerResponseHook
+Inherited from AbstractPool.beforePromiseResponseHook
-- Defined in src/pools/abstract-pool.ts:249
Protected
choose-- choose
Worker(): Worker
+- choose
Worker(): [number, Worker]
-
-
+
Chooses a worker for the next task.
-The default implementation uses a round robin algorithm to distribute the load.
+The default uses a round robin algorithm to distribute the load.
-Returns
Worker.
+Returns
[worker key, worker].
Returns Worker
Returns [number, Worker]
Inherited from AbstractPool.chooseWorker
-- Defined in src/pools/abstract-pool.ts:287
Protected
create@@ -327,7 +323,7 @@ Can be overridden.
Returns Worker
Inherited from AbstractPool.createAndSetupWorker
-- Defined in src/pools/abstract-pool.ts:341
Protected
create@@ -338,7 +334,7 @@ Can be overridden.
Returns Worker
Overrides AbstractPool.createWorker
-- Defined in src/pools/cluster/fixed.ts:88
destroy
@@ -349,7 +345,7 @@ Can be overridden.
Returns Promise<void>
Inherited from AbstractPool.destroy
-- Defined in src/pools/abstract-pool.ts:219
destroy Worker
@@ -365,7 +361,7 @@ Can be overridden.
Returns void
Overrides AbstractPool.destroyWorker
-- Defined in src/pools/cluster/fixed.ts:69
execute
@@ -381,91 +377,27 @@ Can be overridden.
Returns Promise<Response>
Inherited from AbstractPool.execute
-- Defined in src/pools/abstract-pool.ts:205
find Free Worker
+find Free Worker Key
-- find
Free Worker(): false | Worker
+- find
Free Worker Key(): number
-
-
-
Inherit Doc
Returns false | Worker
Inherited from AbstractPool.findFreeWorker
--- Defined in src/pools/abstract-pool.ts:194
get Worker Average Tasks Run Time
--- get
Worker Average Tasks Run Time(worker: Worker): undefined | number
--
-
-
-
-
-
-
Inherit Doc
Parameters
---
-
worker: Worker
Returns undefined | number
Inherited from AbstractPool.getWorkerAverageTasksRunTime
--- Defined in src/pools/abstract-pool.ts:166
get Worker Index
--- get
Worker Index(worker: Worker): number
--
-
-
-
-
-
Inherit Doc
Parameters
---
-
worker: Worker
Returns number
Inherited from AbstractPool.getWorkerIndex
--- Defined in src/pools/abstract-pool.ts:156
get Worker Running Tasks
--- get
Worker Running Tasks(worker: Worker): undefined | number
--
-
-
-
-
-
-
Inherit Doc
Parameters
---
-
worker: Worker
Returns undefined | number
Inherited from AbstractPool.getWorkerRunningTasks
--- Defined in src/pools/abstract-pool.ts:161
Execute
-Protected
internal-- internal
Execute(worker: Worker, messageId: number): Promise<Response>
--
-
-
-
-
Parameters
---
-
--
-
worker: Worker
messageId: number
Returns Promise<Response>
Inherited from AbstractPool.internalExecute
+Inherited from AbstractPool.findFreeWorkerKey
-- Defined in src/pools/abstract-pool.ts:312
Get Busy Status
+Protected
internalProtected
internal-- internal
Get Busy Status(): boolean
+- internal
Busy(): boolean
-
-
Returns boolean
Inherited from AbstractPool.internalGetBusyStatus
+Inherited from AbstractPool.internalBusy
-- Defined in src/pools/abstract-pool.ts:186
Protected
is@@ -476,7 +408,7 @@ Can be overridden.
Returns boolean
Overrides AbstractPool.isMain
-- Defined in src/pools/cluster/fixed.ts:64
register Worker Message Listener
@@ -510,7 +442,7 @@ Can be overridden.
Returns void
Overrides AbstractPool.registerWorkerMessageListener
-- Defined in src/pools/cluster/fixed.ts:80
Protected
remove@@ -528,7 +460,7 @@ Can be overridden.
Returns void
Inherited from AbstractPool.removeWorker
-- Defined in src/pools/abstract-pool.ts:274
Protected
send@@ -546,11 +478,11 @@ Can be overridden.
Returns void
Overrides AbstractPool.sendToWorker
-- Defined in src/pools/cluster/fixed.ts:75
set Worker Choice Strategy
-- set
Worker Choice Strategy(workerChoiceStrategy: "ROUND_ROBIN" | "LESS_RECENTLY_USED" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"): void
+- set
Worker Choice Strategy(workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"): void
-
@@ -558,11 +490,11 @@ Can be overridden.
-
-
Inherit Doc
Parameters
workerChoiceStrategy: "ROUND_ROBIN" | "LESS_RECENTLY_USED" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"
workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"
Returns void
Inherited from AbstractPool.setWorkerChoiceStrategy
-- Defined in src/pools/abstract-pool.ts:171
Protected
setup@@ -573,7 +505,7 @@ Can be overridden.
Returns void
Overrides AbstractPool.setupHook
-- Defined in src/pools/cluster/fixed.ts:59
Protected
worker@@ -601,7 +533,7 @@ Can be overridden.
Returns void
Inherited from AbstractPool.workerListener
-- Defined in src/pools/abstract-pool.ts:365
@@ -630,31 +562,26 @@ Can be overridden.constructor
emitter?
file Path
-next Message Id
number Of Workers
opts
-promise Map
+promise Response Map
worker Choice Strategy Context
workers
-workers Tasks Usage
busy
-number Of Running Tasks
+full
+number Of Running Tasks
type
-after Promise Worker Response Hook
+after Promise Response Hook
after Worker Setup
-before Promise Worker Response Hook
+before Promise Response Hook
choose Worker
create And Setup Worker
create Worker
destroy
destroy Worker
execute
-find Free Worker
-get Worker Average Tasks Run Time
-get Worker Index
-get Worker Running Tasks
-internal Execute
-internal Get Busy Status
+find Free Worker Key
+internal Busy
is Main
register Worker Message Listener
remove Worker