X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=ee6528c7ecbdceafae2a69a8bbd2c4c76abe0eb1;hb=65ec4e64a4690b019d3ef86c97aa7182b715f539;hp=388b91568f37a8f74f3a04cc4cbbcdb3faba48bf;hpb=3bd6a82e43e11294af91bbd19647944ac740169e;p=poolifier.git
diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html
index 388b9156..ee6528c7 100644
--- a/docs/classes/AbstractWorker.html
+++ b/docs/classes/AbstractWorker.html
@@ -18,9 +18,9 @@
Type of main worker. Constructs a new poolifier worker. Whether this is the main worker or not. Function processed by the worker when the pool's Reference to main worker. Options for the worker. Overrides AsyncResource.constructorType Parameters
-
+
MainWorker extends Worker | MessagePort
@@ -84,13 +84,13 @@
constructor
-
Type Parameters
-
+
MainWorker extends Worker | MessagePort
fn: WorkerFunction<Data, Response>
+fn: WorkerFunction<Data, Response>
execution
function is invoked.opts: WorkerOptions = ...
+opts: WorkerOptions = ...
Returns AbstractWorker<MainWorker, Data, Response>
Returns AbstractWorker<MainWorker, Data, Response>
-
Protected
Optional
Readonly
aliveHandler 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.
Protected
Readonly
optsOptions for the worker.
The unique asyncId
assigned to the resource.
The unique asyncId
assigned to the resource.
Inherited from AsyncResource.asyncId
Binds the given function to execute to this AsyncResource
's scope.
The returned function will have an asyncResource
property referencing
@@ -186,9 +185,9 @@ the AsyncResource
to which the function is bound.
v14.8.0, v12.19.0
AsyncResource
to which the function is bound.
The function to bind to the current AsyncResource
.
Inherited from AsyncResource.bind
Protected
checkChecks 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.
Input data for the given function.
Protected
runRuns the given function asynchronously.
Function that will be executed.
Input 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 @@ -364,9 +360,9 @@ then restore the original execution context.
v9.6.0
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
@@ -443,9 +438,9 @@ the AsyncResource
to which the function is bound.
v14.8.0, v12.19.0
AsyncResource
to which the function is bound.
Optional
thisArg: ThisArgInherited from AsyncResource.bind
Base class that implements some shared logic for all poolifier workers.