X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=docs%2Fclasses%2FAbstractWorker.html;h=460aac9df0eb0d25f61fdfaa12a766b43df5de46;hb=3dd69d8ee8aa2132fccb106720a9f5ae67b92cc8;hp=88a908c324ef4646e4e540fe10094abc103cee58;hpb=f1583b4edd427f8c3f2b4ddc652d2e102390b08e;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 88a908c3..460aac9d 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,15 @@ -
Constructs a new poolifier worker.
The type of async event.
Whether this is the main worker or not.
Function processed by the worker when the pool's execution
function is invoked.
Reference to main worker.
Options for the worker.
Protected
Optional
Readonly
aliveHandler Id of the aliveInterval
worker alive check.
Handler id of the aliveInterval
worker alive check.
Protected
Readonly
isWhether this is the main worker or not.
Protected
lastTimestamp of the last task processed by this worker.
Protected
mainReference to main worker.
+Readonly
optsProtected
Readonly
optsOptions for the worker.
Binds the given function to execute to this AsyncResource
's scope.
The returned function will have an asyncResource
property referencing
@@ -185,36 +185,36 @@ the AsyncResource
to which the function is bound.
v14.8.0, v12.19.0
The function to bind to the current AsyncResource
.
Inherited from AsyncResource.bind
Protected
checkCheck to see if the worker should be terminated, because its living too long.
+Checks if the worker should be terminated, because its living too long.
Private
checkChecks if the fn
parameter is passed to the constructor.
AsyncResource
to which the function is bound.
The function that should be defined.
-Private
checkCall all destroy
hooks. This should only ever be called once. An error will
be thrown if it is called more than once. This must be manually called. If
the resource is left to be collected by the GC then the destroy
hooks will
never be called.
A reference to asyncResource
.
A reference to asyncResource
.
Inherited from AsyncResource.emitDestroy
Protected
getReturns the main worker.
- -Reference to the main worker.
Reference to the main worker.
+Protected
handleHandles an error and convert it to a string so it can be sent back to the main worker.
- -Message of the error.
The error raised by the worker.
Message of the error.
+Protected
messageWorker message listener.
+Message received.
+Function processed by the worker when the pool's execution
function is invoked.
Protected
runRuns the given function synchronously.
Function that will be executed.
-Optional
data: DataInput data for the given function.
Protected
runRuns the given function asynchronously.
Function that will be executed.
-Optional
data: DataInput data for the given function.
Call the provided function with the provided arguments in the execution context of the async resource. This will establish the context, trigger the AsyncHooks @@ -401,49 +360,49 @@ then restore the original execution context.
v9.6.0
The function to call in the execution context of this async resource.
Rest
...args: any[]Rest
...args: any[]Optional
thisArg: ThisOptional
thisArg: ThisThe receiver to be used for the function call.
Rest
...args: any[]Rest
...args: any[]Optional arguments to pass to the function.
Inherited from AsyncResource.runInAsyncScope
Protected
Abstract
sendSends a message to the main worker.
The response message.
The same triggerAsyncId
that is passed to the AsyncResource
constructor.
The same triggerAsyncId
that is passed to the AsyncResource
constructor.
Inherited from AsyncResource.triggerAsyncId
Static
bindBinds the given function to the current execution context.
The returned function will have an asyncResource
property referencing
@@ -480,34 +438,35 @@ the AsyncResource
to which the function is bound.
v14.8.0, v12.19.0
The function to bind to the current execution context.
Optional
type: stringOptional
type: stringAn optional name to associate with the underlying AsyncResource
.
Optional
thisArg: ThisArgOptional
thisArg: ThisArgInherited from AsyncResource.bind
Generated using TypeDoc
Base class that implements some shared logic for all poolifier workers.