X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=11212b2005cb21a76266044a1d3316fcba230c16;hb=f7d15c1217381b306300beb7926b42fde93bc579;hp=10e968f8a809e4966a607183ffab07d4170bbe17;hpb=0e502832d98443e291ea5558423ca0de86b96e13;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 10e968f8..11212b20 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,4 +1,4 @@ -
Protected
Readonly
fileProtected
Readonly
maxProtected
Readonly
numberProtected
Readonly
optsProtected
promise
The task 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.Protected
workerReadonly
Internal
workerAccessors
Protected
full@@ -267,7 +272,7 @@ When the maximum number of workers is reached and workers are busy, an event is
info
@@ -279,7 +284,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
max@@ -291,7 +296,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
min@@ -303,7 +308,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Private
ready@@ -315,7 +320,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
type@@ -328,7 +333,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Private
utilization@@ -341,7 +346,7 @@ When the maximum number of workers is reached and workers are busy, an event is
Protected
worker@@ -353,9 +358,40 @@ When the maximum number of workers is reached and workers are busy, an event is
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@@ -381,7 +417,7 @@ Can be overridden.
Protected
after@@ -402,7 +438,7 @@ Can be overridden.
Protected
before@@ -428,7 +464,7 @@ Can be overridden.
Protected
check@@ -444,7 +480,7 @@ Can be overridden.
Returns void
Protected
create@@ -457,7 +493,7 @@ Can be overridden.
Protected
create@@ -470,7 +506,7 @@ Can be overridden.
Protected
create@@ -483,7 +519,7 @@ Can be overridden.
destroy
@@ -495,7 +531,7 @@ Can be overridden.
Protected
destroy@@ -515,7 +551,7 @@ Can be overridden.
enable Tasks Queue
@@ -540,7 +576,7 @@ Can be overridden.
execute
@@ -571,7 +607,7 @@ Can be overridden.
Protected
flush@@ -585,7 +621,7 @@ Can be overridden.
Returns void
Protected
get@@ -606,7 +642,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
@@ -627,7 +684,7 @@ Can be overridden.
Protected
internal@@ -640,7 +697,7 @@ Can be overridden.
Protected
is@@ -652,20 +709,20 @@ 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.
Protected
register@@ -706,23 +763,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@@ -742,7 +818,7 @@ Can be overridden.
Protected
send@@ -767,7 +843,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
@@ -787,7 +884,7 @@ Can be overridden.
set Worker Choice Strategy
@@ -812,7 +909,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -832,7 +929,7 @@ Can be overridden.
Protected
setup@@ -845,7 +942,19 @@ Can be overridden.
start
++- start(): void
+-
+
+
Starts the minimum number of workers in this pool.
+Returns void
+Protected
worker@@ -873,7 +982,7 @@ Can be overridden.