X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=c3a79eecdf9d5a71e8b0258e53321f43a4f97bbf;hb=4cb259d3e1837759b8bac901d3755f1610b5ddc4;hp=960f1b1b6ee52ab3994755910e93bc43c9f1468b;hpb=7d3ed70ed3ebb6a3656041db3c6ea23a1f354616;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 960f1b1b..c3a79eec 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,13 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier - v2.6.42
-
+
  • The search index is not available
  • poolifier - v2.6.42 +
    @@ -17,592 +17,918 @@

    Class AbstractWorker<MainWorker, Data, Response>Abstract

    Base class that implements some shared logic for all poolifier workers.

    -
    -
    +
    +
    +

    Type Parameters

    -
    +
  • -

    Data = unknown

    -

    Type of data this worker receives from pool's execution. This can only be serializable data.

    -
  • +

    Data = unknown

    +

    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.

    -
  • +

    Response = unknown

    +

    Type of response the worker sends back to the main worker. This can only be structured-cloneable data.

    +
    +

    Hierarchy

    - +

    Constructors

    -
    - - -

    Returns AbstractWorker<MainWorker, Data, Response>

    +
  • Defined in src/worker/abstract-worker.ts:83
  • Properties

    -
    - -
    aliveInterval?: Timeout
    -

    Handler id of the aliveInterval worker alive check.

    -
    +
    + +
    isMain: boolean

    Whether this is the main worker or not.

    -
    -
    - -
    lastTaskTimestamp: number
    +
  • Defined in src/worker/abstract-worker.ts:85
  • +
    + +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MainWorker
    +
  • Defined in src/worker/abstract-worker.ts:65
  • +
    + +
    mainWorker: MainWorker

    Reference to main worker.

    -
    -
    - -
    opts: WorkerOptions = ...
    +
  • Defined in src/worker/abstract-worker.ts:86
  • +
    + +
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

    +
    +
    +
    + +
    taskFunctions: Map<string, TaskFunction<Data, Response>>
    +

    Task function(s) processed by the worker when the pool's execution function is invoked.

    +
    +
    +
  • Defined in src/worker/abstract-worker.ts:61
  • Methods

    -
    - -
    +
    + +
    +
    + +

    Parameters

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    -
    - -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    - -
    +
    + +
    +
    + + +
    name: string
    +
  • +
    fn: TaskFunction<Data, Response>
  • Returns void

    -
    - -
    +
    + +

    Returns void

    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    -
    - -
    +
    + + +

    Returns string

    The error message.

    + +
    -
    - -
    +
    + +
    +
    + + -

    Returns void

    -
    - -
    +
    + +
    +
    + +
    +
    + + +
    message: MessageValue<Data, unknown>
    +

    The received message.

    +
    +
    +

    Returns void

    +
    +
    + + +

    Returns boolean

    Whether the task function existed and was removed or not.

    + +
    +

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string or an empty string.

    + +

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the default task function reserved name.

    + +

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the task function used as default task function.

    +
    -
    - -
    +
    + +
    +
    + + +
    fn: TaskAsyncFunction<Data, Response>
    +

    Task function that will be executed.

    +
    +
  • -
    message: MessageValue<Data, unknown>
    -

    Input data for the given function.

    -
  • -

    Returns void

    -
    - -
    +
    + +

    Parameters

    +

    Returns Result

  • -
    Optional thisArg: This
    +
    Optional thisArg: This

    The receiver to be used for the function call.

    -
  • + +
  • -
    Rest ...args: any[]
    +
    Rest ...args: any[]

    Optional arguments to pass to the function.

    -
  • -

    Returns Result

    +
    + +
    +
    + +
    +
    + + +

    Returns void

    +
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    - -
    +
    + +
    +
    + +

    Parameters

    +
  • -
    Optional type: string
    +
    Optional type: string

    An optional name to associate with the underlying AsyncResource.

    -
  • + +
  • -
    Optional thisArg: ThisArg
  • -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    +

    Theme

    -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • activeInterval
  • +
  • id
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkActive
  • +
  • checkMessageWorkerId
  • +
  • checkStatistics
  • +
  • checkTaskFunctionName
  • +
  • checkTaskFunctions
  • +
  • checkValidTaskFunction
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • endTaskPerformance
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctions
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionsListToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • startCheckActive
  • +
  • stopCheckActive
  • +
  • triggerAsyncId
  • +
  • updateLastTaskTimestamp
  • +
  • bind
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file