X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FAbstractWorker.html;h=08ca88046ddb27768ebecadbb837bd4835a783a0;hb=1bb559f95ee0232e20550e28e4cfd3f6556cd8a8;hp=3f516fbf49f525bd73183cfaac4da3accc132cb3;hpb=8d1797ad15cb2d87ac3c9904ce6df3db45c0c742;p=poolifier.git
diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html
index 3f516fbf..08ca8804 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 Task function(s) processed by the worker when the pool's Handler id of the Whether this is the main worker or not. Timestamp of the last task processed by this worker. Reference to main worker. Options for the worker. Task function(s) processed by the worker when the pool's Binds the given function to execute to this The returned function will have an v14.8.0, v12.19.0 The function to bind to the current Inherited from AsyncResource.bind Checks if the Checks if the The function that should be defined. The task function(s) parameter that should be checked. A reference to A reference to Inherited from AsyncResource.emitDestroy Returns the main worker. Reference to the main worker. Reference to the main worker. Gets the task function in the given scope. Name of the function that will be returned. Handles 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. Worker message listener. Message received. Function processed by the worker when the pool's Runs the given function synchronously. Function that will be executed. Input data for the given function.Type Parameters
-
+
MainWorker extends Worker | MessagePort
@@ -60,21 +60,23 @@
last
Methods
constructor
-
Type Parameters
-
+
MainWorker extends Worker | MessagePort
fn: WorkerFunction<Data, Response>
-execution
function is invoked.taskFunctions: WorkerFunction<Data, Response> | TaskFunctions<Data, Response>
+execution
function is invoked. The first function is the default function.mainWorker: undefined | null | MainWorker
@@ -123,7 +125,7 @@
Returns AbstractWorker<MainWorker, Data, Response>
Properties
aliveInterval
worker alive check.Protected
Readonly
isProtected
lastProtected
mainProtected
Readonly
opts
+
+Protected
taskexecution
function is invoked.Methods
bind
-
    asyncResource: AsyncResource;
}AsyncResource
's scope.asyncResource
property referencing
-the AsyncResource
to which the function is bound.Since
Type Parameters
-
+
Func extends ((...args) => any)
AsyncResource
to which the function is bound.
fn: Func
AsyncResource
.Returns Func & {
    asyncResource: AsyncResource;
}Returns Func
-
Protected
check
@@ -211,24 +217,24 @@ the
AsyncResource
to which the function is bound.
Returns void
-
+Private
checkPrivate
check
-
fn
parameter is passed to the constructor.taskFunctions
parameter is passed to the constructor.Parameters
+fn: WorkerFunction<Data, Response>
-taskFunctions: WorkerFunction<Data, Response> | TaskFunctions<Data, Response>
+Returns void
-
Private
check
@@ -241,7 +247,7 @@ the
AsyncResource
to which the function is bound.
opts: WorkerOptions
Returns void
-
emit
@@ -251,33 +257,46 @@ the
AsyncResource
to which the function is bound.
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.
-
-Returns
asyncResource
.Returns AbstractWorker<MainWorker, Data, Response>
Returns AbstractWorker<MainWorker, Data, Response>
asyncResource
.
-
Protected
get
Returns
Returns MainWorker
Returns MainWorker
+
+Private
get
+
Parameters
+
+
+Optional
name: stringReturns WorkerFunction<Data, Response>
-
Protected
handle
Returns
Parameters
@@ -286,13 +305,14 @@ never be called.
e: string | Error
Returns string
Returns string
-
Protected
message
-
message: MessageValue<Data, MainWorker>
fn: WorkerFunction<Data, Response>
-execution
function is invoked.Returns void
-
-Protected
run
-
Parameters
-
-
fn: WorkerSyncFunction<Data, Response>
-message: MessageValue<Data, unknown>
-Returns void
-
Protected
run
@@ -346,12 +341,12 @@ never be called.
Function that will be executed.
Input data for the given function.
v9.6.0
-Inherited from AsyncResource.runInAsyncScope
Protected
runRuns the given function synchronously.
+Function that will be executed.
+Input data for the given function.
+Protected
Abstract
sendThe 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
-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.