X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=e1e40fe844479b948bc6d6a374669be7a7913916;hb=6c285176ad7e73f183942ebc427d144a76d96057;hp=0c52886e04db9b8851f1c9de9bb4282b0de0adee;hpb=3eed67feea0f527e3ee31a6ebb1063883eec3855;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 0c52886e..e1e40fe8 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -
Optional
Readonly
emitterGenerated using TypeDoc
Emitter 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:
'ready'
: Emitted when the number of workers created in the pool has reached the minimum size expected and are ready.Protected
Readonly
fileProtected
Optional
Readonly
maxProtected
Readonly
numberProtected
Readonly
optsProtected
promiseProtected
workerReadonly
Internal
workerAccessors
Protected
full@@ -263,7 +270,7 @@
info
@@ -275,7 +282,7 @@
Protected
max@@ -287,7 +294,7 @@
Protected
min@@ -299,7 +306,7 @@
Private
ready@@ -311,7 +318,7 @@
Protected
type@@ -324,7 +331,7 @@
Private
utilization@@ -337,7 +344,7 @@
Protected
worker@@ -349,9 +356,40 @@
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.Protected
after@@ -377,7 +415,7 @@ Can be overridden.
Protected
after@@ -398,7 +436,7 @@ Can be overridden.
Protected
before@@ -424,23 +462,7 @@ Can be overridden.
Dynamic Pool Size
-Protected
check-- check
Dynamic Pool Size(min, max): void
--
-
-
-
Parameters
---
-
--
-
min: number
max: number
Returns void
Protected
create@@ -453,7 +475,7 @@ Can be overridden.
Protected
create@@ -466,7 +488,7 @@ Can be overridden.
Protected
create@@ -479,7 +501,48 @@ Can be overridden.
Worker Message Listener
+Protected
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
@@ -491,7 +554,7 @@ Can be overridden.
Protected
destroy@@ -511,7 +574,7 @@ Can be overridden.
enable Tasks Queue
@@ -536,7 +599,7 @@ Can be overridden.
execute
@@ -567,7 +630,21 @@ Can be overridden.
Worker Node As Not Ready
+Protected
flag+- flag
Worker Node As Not Ready(workerNodeKey): void
+-
+
+
+
Parameters
++-
+
workerNodeKey: number
Returns void
Protected
flush@@ -581,7 +658,7 @@ Can be overridden.
Returns void
Protected
get@@ -602,7 +679,28 @@ Can be overridden.
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
@@ -623,7 +721,7 @@ Can be overridden.
Protected
internal@@ -636,7 +734,7 @@ Can be overridden.
Protected
is@@ -648,20 +746,61 @@ Can be overridden.
list Task Functions
+list Task Function Names
-- list
Task Functions(): string[]
+- 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.
Once Worker Message Listener
+Protected
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
++-
+
+
+-
+
+
+
workerNodeKey: number
+The worker node key.
+listener: ((message) => void)
+The message listener callback.
++-
+
+- (message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Message, unknown>
Returns void
Returns void
+Protected
register@@ -702,23 +841,42 @@ Can be overridden.
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.Protected
send-- send
Kill Message To Worker(workerNodeKey, workerId): Promise<void>
+- send
Kill Message To Worker(workerNodeKey): Promise<void>
-
-
-
--
-
+
Parameters
workerNodeKey: number
workerId: number
workerNodeKey: number
Returns Promise<void>
+Protected
send@@ -738,7 +896,7 @@ Can be overridden.
Protected
send@@ -768,7 +926,28 @@ Can be overridden.
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.set Tasks Queue Options
@@ -788,7 +967,7 @@ Can be overridden.
set Worker Choice Strategy
@@ -813,7 +992,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -833,7 +1012,7 @@ Can be overridden.
Protected
setup@@ -846,7 +1025,7 @@ Can be overridden.
start
@@ -858,35 +1037,24 @@ Can be overridden.
Listener
+Protected
workerProtected
worker-- worker
Listener(): ((message) => void)
+- worker
Message Listener(message): void
-
-
-
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.
- ---
-
-- (message): void
--
-
-
-
+ - Defined in src/pools/abstract-pool.ts:1519
This method is the listener registered for each worker message.
+This method is the message listener registered on each worker.
Parameters
message: MessageValue<Response, unknown>
Returns void
The listener function to execute when a message is received from a worker.
- - +Returns void