X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FAbstractWorker.html;h=3320ed35e15e0e83a12bd513e8bf748e3c512a75;hb=28bcd7a31d95fd283814fad692d77b4994c2ac9c;hp=930d4484b2db673b5c4a98533b253a7dc17fc2e3;hpb=2493c34370d0839614058bb55254fd7aec91b664;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 930d4484..3320ed35 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,8 +1,8 @@ -
Base class that implements some shared logic for all poolifier workers.
+- Preparing search index...
- The search index is not available
poolifier - v4.0.13Class AbstractWorker<MainWorker, Data, Response>
Abstract
Base class that implements some shared logic for all poolifier workers.
Type Parameters
Type of main worker.
Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
Type of response the worker sends back to the main worker. This can only be structured-cloneable data.
-Hierarchy (view full)
Index
Constructors
Hierarchy (view full)
Index
Constructors
Properties
Reference to main worker.
Task function(s) processed by the worker when the pool's
execution
function is invoked. The first function is the default function.Options for the worker.
-Returns AbstractWorker<MainWorker, Data, Response>
Properties
Protected
Optional
activeHandler id of the
-activeInterval
worker activity check.Protected
Abstract
idWorker id.
-Protected
Readonly
isWhether this is the main worker or not.
-Protected
lastTimestamp of the last task processed by this worker.
-Private
Readonly
mainReference to main worker.
-Protected
optsOptions for the worker.
-Protected
Optional
statisticsPerformance statistics computation requirements.
-Protected
taskTask function object(s) processed by the worker when the pool's
-execution
function is invoked.Methods
add Task Function
Adds a task function to the worker. +
Returns AbstractWorker<MainWorker, Data, Response>
Properties
Protected
Optional
activeHandler id of the
+activeInterval
worker activity check.Protected
Abstract
idWorker id.
+Protected
Readonly
isWhether this is the main worker or not.
+Protected
lastTimestamp of the last task processed by this worker.
+Private
Readonly
mainReference to main worker.
+Protected
optsOptions for the worker.
+Protected
Optional
statisticsPerformance statistics computation requirements.
+Protected
taskTask function object(s) processed by the worker when the pool's
+execution
function is invoked.Methods
add Task Function
Adds a task function to the worker. If a task function with the same name already exists, it is replaced.
Parameters
The name of the task function to add.
The task function to add.
Returns TaskFunctionOperationResult
Whether the task function was added or not.
-Private
beginParameters
Optional
name: stringReturns TaskPerformance
Private
checkChecks if the worker should be terminated, because its living too long.
-Returns void
Private
checkCheck if the message worker id is set and matches the worker id.
+Private
beginParameters
Optional
name: stringReturns TaskPerformance
Private
checkChecks if the worker should be terminated, because its living too long.
+Returns void
Private
checkCheck if the message worker id is set and matches the worker id.
Parameters
The message to check.
Returns void
Throws
https://nodejs.org/api/errors.html#class-error If the message worker id is not set or does not match the worker id.
-Private
checkChecks if the
+taskFunctions
parameter is passed to the constructor and valid.Private
checkChecks if the
taskFunctions
parameter is passed to the constructor and valid.Parameters
The task function(s) parameter that should be checked.
-Returns void
Private
checkParameters
Returns void
Private
endParameters
Returns TaskPerformance
Protected
getReturns the main worker.
+Returns void
Private
checkParameters
Returns void
Private
endParameters
Returns TaskPerformance
Protected
getReturns the main worker.
Returns MainWorker
Reference to the main worker.
Throws
https://nodejs.org/api/errors.html#class-error If the main worker is not set.
-Protected
handleHandles an error and convert it to a string so it can be sent back to the main worker.
+Protected
handleHandles an error and convert it to a string so it can be sent back to the main worker.
Parameters
The error raised by the worker.
Returns string
The error message.
-Protected
handleHandles a kill message sent by the main worker.
-Parameters
Returns void
Protected
Abstract
handleHandles the ready message sent by the main worker.
+Protected
handleHandles a kill message sent by the main worker.
+Parameters
Returns void
Protected
Abstract
handleHandles the ready message sent by the main worker.
Parameters
The ready message.
-Returns void
Protected
handleParameters
Returns void
has Task Function
Checks if the worker has a task function with the given name.
+Returns void
Protected
handleParameters
Returns void
has Task Function
Checks if the worker has a task function with the given name.
Parameters
The name of the task function to check.
Returns TaskFunctionOperationResult
Whether the worker has a task function with the given name or not.
-list Task Functions Properties
Lists the properties of the worker's task functions.
+list Task Functions Properties
Lists the properties of the worker's task functions.
Returns TaskFunctionProperties[]
The properties of the worker's task functions.
-Protected
messageWorker message listener.
+Protected
messageWorker message listener.
Parameters
The received message.
-Returns void
remove Task Function
Removes a task function from the worker.
+Returns void
remove Task Function
Removes a task function from the worker.
Parameters
The name of the task function to remove.
Returns TaskFunctionOperationResult
Whether the task function existed and was removed or not.
-Protected
Readonly
runRuns the given task.
+Protected
Readonly
runRuns the given task.
Parameters
The task to execute.
-Returns void
Protected
Readonly
runRuns the given task function asynchronously.
+Returns void
Protected
Readonly
runRuns the given task function asynchronously.
Parameters
Task function that will be executed.
Input data for the task function.
-Returns void
Protected
Readonly
runRuns the given task function synchronously.
+Returns void
Protected
Readonly
runRuns the given task function synchronously.
Parameters
Task function that will be executed.
Input data for the task function.
-Returns void
Protected
sendSends task functions properties to the main worker.
-Returns void
Protected
Abstract
sendSends a message to main worker.
+Returns void
Protected
sendSends task functions properties to the main worker.
+Returns void
Protected
Abstract
sendSends a message to main worker.
Parameters
The response message.
-Returns void
set Default Task Function
Sets the default task function to use in the worker.
+Returns void
set Default Task Function
Sets the default task function to use in the worker.
Parameters
The name of the task function to use as default task function.
Returns TaskFunctionOperationResult
Whether the default task function was set or not.
-Private
startStarts the worker check active interval.
-Returns void
Private
stopStops the worker check active interval.
-Returns void
Private
updateReturns void
Settings
Member Visibility
Theme
On This Page