X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=a4a272b70f3eca7faa11a45859de6cdf166d38a6;hb=76b46937556ea55049d5c413aa0a77d0c7f47f48;hp=b23ee1e776d8d42d0b617c4d02f17ab847856a59;hpb=a97f9c80aa49c6152547fb6fa8de4b0f089c2353;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index b23ee1e7..a4a272b7 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -
Emitter on which events can be listened to.
Events that can currently be listened to:
-
-
+
+
+
@@ -152,7 +160,7 @@ +'full'
: Emitted when the pool is dynamic and full.'busy'
: Emitted when the pool is busy.'full'
: Emitted when the pool is dynamic and the number of workers created has reached the maximum size expected.'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.'error'
: Emitted when an uncaught error occurs.'taskError'
: Emitted when an error occurs while executing a task.Protected
Readonly
fileProtected
Readonly
numberProtected
Readonly
optsProtected
promiseProtected
worker Nodes
-Readonly
workerPool worker nodes.
Accessors
Protected
full@@ -239,7 +247,7 @@
info
@@ -251,7 +259,7 @@
Protected
max@@ -263,7 +271,7 @@
Protected
min@@ -275,7 +283,16 @@
+Private
ready+- get ready(): boolean
+-
+
Returns boolean
Protected
type@@ -288,7 +305,20 @@
+Private
utilization+- get utilization(): number
+-
+
+
Gets the approximate pool utilization.
+Returns number
The pool utilization.
+ +Protected
worker@@ -300,7 +330,7 @@
Methods
Protected
after@@ -349,7 +379,7 @@ Can be overridden.
Protected
before@@ -375,7 +405,23 @@ Can be overridden.
Dynamic Pool Size
+Protected
check+- check
Dynamic Pool Size(min, max): void
+-
+
+
+
Parameters
++-
+
+-
+
min: number
max: number
Returns void
Protected
create@@ -388,7 +434,7 @@ Can be overridden.
Protected
create@@ -401,7 +447,7 @@ Can be overridden.
Protected
create@@ -414,19 +460,19 @@ Can be overridden.
destroy
Terminate every current worker in this pool.
+Terminates every current worker in this pool.
Returns Promise<void>
+Protected
destroy@@ -446,7 +492,7 @@ Can be overridden.
enable Tasks Queue
@@ -471,7 +517,7 @@ Can be overridden.
execute
@@ -497,7 +543,51 @@ Can be overridden.
Worker Info By Worker
+Protected
get+- get
Worker Info By Worker(worker): WorkerInfo
+-
+
+
+
+
+
Gets the worker information from the given worker.
+Parameters
++-
+
+
worker: Worker
+The worker.
+Returns WorkerInfo
The worker information.
+ +Throws
https://nodejs.org/api/errors.html#class-error If the worker is not found.
+ Worker Node Key
+Protected
get+- get
Worker Node Key(worker): number
+-
+
+
+
+
Gets the given worker its worker node key.
+Parameters
++-
+
+
worker: Worker
+The worker.
+Returns number
The worker node key if found in the pool worker nodes,
+ +-1
otherwise.Protected
internal@@ -510,7 +600,7 @@ Can be overridden.
Protected
is@@ -522,7 +612,68 @@ 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: Worker
+The worker which should register a listener.
+listener: ((message) => void)
+The message listener callback.
++-
+
+- (message): void
+-
+
+
+
Parameters
++-
+
message: MessageValue<Message, unknown>
Returns void
Returns void
+ Startup Message To Worker
+Protected
send+- send
Startup Message To Worker(worker): void
+-
+
+
+
+
Sends the startup message to the given worker.
+Parameters
++-
+
+
worker: Worker
+The worker which should receive the startup message.
+Returns void
+Protected
send@@ -547,7 +698,7 @@ Can be overridden.
set Tasks Queue Options
@@ -567,7 +718,7 @@ Can be overridden.
set Worker Choice Strategy
@@ -592,7 +743,7 @@ Can be overridden.
set Worker Choice Strategy Options
@@ -612,7 +763,7 @@ Can be overridden.
Protected
setup@@ -625,7 +776,7 @@ Can be overridden.
Protected
worker@@ -653,7 +804,7 @@ Can be overridden.