X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=98f5c30d4c20f78c2b940cc01118016592505737;hb=447eca603b96bc46303dfa16f3048b68ae576b0c;hp=1716132ec7d23928b8eb717416704e153e50eace;hpb=fd13902fd959335e2c0f95d1b464317a2da8b6cf;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 1716132e..98f5c30d 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,13 +1,13 @@ -
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.'busy'
: Emitted when the number of workers created in the pool has reached the maximum size expected and are executing at least one task.'busy'
: Emitted when the number of workers created in the pool has reached the maximum size expected and are executing concurrently their tasks quota.'full'
: Emitted when the pool is dynamic and the number of workers created has reached the maximum size expected.destroy
': Emitted when the pool is destroyed.'destroy'
: Emitted when the pool is destroyed.'error'
: Emitted when an uncaught error occurs.'taskError'
: Emitted when an error occurs while executing a task.'backPressure'
: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= pool maximum size^2).'backPressure'
: Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).Protected
Readonly
fileProtected
Optional
Readonly
maxProtected
Readonly
numberProtected
Readonly
optsProtected
promiseGenerated using TypeDoc
Generated using TypeDoc
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@@ -262,7 +267,7 @@
info
@@ -274,7 +279,7 @@
Protected
max@@ -286,7 +291,7 @@
Protected
min@@ -298,7 +303,7 @@
Private
ready@@ -310,7 +315,7 @@
Protected
type@@ -323,7 +328,7 @@
Private
utilization@@ -336,7 +341,7 @@
Protected
worker@@ -348,9 +353,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@@ -376,7 +412,7 @@ Can be overridden.
Protected
after@@ -397,7 +433,7 @@ Can be overridden.
Protected
before@@ -423,7 +459,7 @@ Can be overridden.
Protected
check@@ -439,7 +475,7 @@ Can be overridden.
Returns void
Protected
create@@ -452,7 +488,7 @@ Can be overridden.
Protected
create@@ -465,7 +501,7 @@ Can be overridden.
Protected
create@@ -478,7 +514,7 @@ Can be overridden.
destroy
@@ -490,7 +526,7 @@ Can be overridden.
Protected
destroy@@ -510,32 +546,32 @@ Can be overridden.
enable Tasks Queue
Enables/disables the worker tasks queue in this pool.
+Enables/disables the worker node tasks queue in this pool.
Parameters
enable: boolean
-Whether to enable or disable the worker tasks queue.
+Whether to enable or disable the worker node tasks queue.
-Optional
tasksQueueOptions: TasksQueueOptionsThe worker tasks queue options.
+The worker node tasks queue options.
Returns void
execute
@@ -566,7 +602,7 @@ Can be overridden.
Protected
flush@@ -580,7 +616,7 @@ Can be overridden.
Returns void
Protected
get@@ -601,7 +637,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
@@ -622,7 +679,7 @@ Can be overridden.
Protected
internal@@ -635,7 +692,7 @@ Can be overridden.
Protected
is@@ -647,20 +704,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@@ -701,23 +758,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@@ -737,7 +813,7 @@ Can be overridden.
Protected
send@@ -762,27 +838,48 @@ 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
Sets the worker tasks queue options in this pool.
+Sets the worker node tasks queue options in this pool.
Parameters
tasksQueueOptions: TasksQueueOptions
-The worker tasks queue options.
+The worker node tasks queue options.
Returns void
set Worker Choice Strategy
@@ -807,7 +904,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -827,7 +924,7 @@ Can be overridden.
Protected
setup@@ -840,7 +937,19 @@ Can be overridden.
start
++- start(): void
+-
+
+
Starts the minimum number of workers in this pool.
+Returns void
+Protected
worker@@ -868,20 +977,20 @@ Can be overridden.
-
+Settings
Settings
Member Visibility
Theme
@@ -906,6 +1015,7 @@ Can be overridden.- type
- utilization
- worker
+- add
Task Function
- after
Task Execution Hook
- after
Worker Node Setup
- before
Task Execution Hook
@@ -919,82 +1029,48 @@ Can be overridden.
- execute
- flush
Tasks Queue
- get
Worker Info
+- has
Task Function
- has
Worker Node Back Pressure
- internal
Busy
- is
Main
-- list
Task Functions
+- list
Task Function Names
- register
Worker Message Listener
+- remove
Task Function
- send
Kill Message To Worker
- send
Startup Message To Worker
- send
To Worker
+- set
Default Task Function
- set
Tasks Queue Options
- set
Worker Choice Strategy
- set
Worker Choice Strategy Options
- setup
Hook
+- start
- worker
Listener