X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=f0cdd40c873da0fce4161c6ce0659a0bb225e57a;hb=5a24d71c903b876f660285d52b2369a5496954e5;hp=30f41d2a1c1bfc06f52cc4f6e55eeea5c1d5aed4;hpb=aac8863d208eadcb0ecb33dc44d045c26f5a444f;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 30f41d2a..1d5f2f8b 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -
Protected
Optional
Readonly
aliveHandler id of the aliveInterval
worker alive check.
Protected
Optional
activeHandler id of the activeInterval
worker activity check.
Protected
Readonly
isProtected
lastProtected
mainReference to main worker.
-Protected
Readonly
optsProtected
optsOptions for the worker.
Protected
statisticsPerformance statistics computation.
+Performance statistics computation requirements.
Protected
taskTask function(s) processed by the worker when the pool's execution
function is invoked.
Protected
idWorker id.
+Adds a task function to the worker. +If a task function with the same name already exists, it is replaced.
+The name of the task function to add.
+The task function to add.
+Whether the task function was added or not.
+ +https://nodejs.org/api/errors.html#class-typeerror If the name
parameter is not a string or an empty string.
https://nodejs.org/api/errors.html#class-error If the name
parameter is the default task function reserved name.
https://nodejs.org/api/errors.html#class-typeerror If the fn
parameter is not a function.
The function to bind to the current AsyncResource
.
v14.8.0, v12.19.0
Protected
checkProtected
getProtected
handleProtected
handleHandles a kill message sent by the main worker.
+The kill message.
+Protected
handleHandles the ready message sent by the main worker.
+The ready message.
+Checks if the worker has a task function with the given name.
+The name of the task function to check.
+Whether the worker has a task function with the given name or not.
+ +https://nodejs.org/api/errors.html#class-typeerror If the name
parameter is not a string or an empty string.
Message of the error.
+The names of the worker's task functions.
Protected
messageMessage received.
-The received message.
+Removes a task function from the worker.
+The name of the task function to remove.
+Whether the task function existed and was removed or not.
+ +https://nodejs.org/api/errors.html#class-typeerror If the name
parameter is not a string or an empty string.
https://nodejs.org/api/errors.html#class-error If the name
parameter is the default task function reserved name.
https://nodejs.org/api/errors.html#class-error If the name
parameter is the task function used as default task function.
Protected
runRuns the given task.
+The task to execute.
+https://nodejs.org/api/errors.html#class-error If the task function is not found.
+Protected
runRuns the given function asynchronously.
+Runs the given task function asynchronously.
Function that will be executed.
-Task function that will be executed.
+Input data for the given function.
-Input data for the task function.
+The function to call in the execution context of this async resource.
Rest
...args: any[]Rest
...args: any[]Rest
Optional
thisArg: ThisThe receiver to be used for the function call.
-Optional
Rest
...args: any[]Optional arguments to pass to the function.
-Rest
v9.6.0
Protected
runRuns the given function synchronously.
+Runs the given task function synchronously.
Function that will be executed.
-Task function that will be executed.
+Input data for the given function.
-Input data for the task function.
+Protected
sendProtected
sendSends a message to the main worker.
+Sends a message to main worker.
The response message.
-Sets the default task function to use in the worker.
+The name of the task function to use as default task function.
+Whether the default task function was set or not.
+ +https://nodejs.org/api/errors.html#class-typeerror If the name
parameter is not a string or an empty string.
https://nodejs.org/api/errors.html#class-error If the name
parameter is the default task function reserved name.
https://nodejs.org/api/errors.html#class-error If the name
parameter is a non-existing task function.
Static
bindThe function to bind to the current execution context.
-Optional
type: stringAn optional name to associate with the underlying AsyncResource
.
Optional
Optional
thisArg: ThisArgOptional
thisArg: ThisArgOptional
v14.8.0, v12.19.0
Generated using TypeDoc
Generated using TypeDoc
\ No newline at end of file
Type of data this worker receives from pool's execution. This can only be serializable data.
+Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
Response = unknown
-Type of response the worker sends back to the main worker. This can only be serializable data.
+Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
@@ -59,27 +59,38 @@ but the minimum number of workers will be guaranteed.
Properties
-Accessors
+Methods
-Parameters
taskFunctions: WorkerFunction<Data, Response> | TaskFunctions<Data, Response>
+taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>
Task function(s) processed by the worker when the pool's
-execution
function is invoked.opts: WorkerOptions = {}
Options for the worker.
-