X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=83823ef34f77b0afa3518d50743409132d3fdc02;hb=1639315e9fcda007015bad70bd480f7c8cd68669;hp=dc5c19c94a443f618a488ef5bd48af8951689864;hpb=cea16128a949e8f118627f00ccb33b08db281c45;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index dc5c19c9..83823ef3 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,13 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier - v3.0.0
-
+
  • The search index is not available
  • poolifier - v3.0.0 +
    @@ -17,516 +17,796 @@

    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:89
  • 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:91
  • +
    + +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

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

    Options for the worker.

    -
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

    +
    +
    +
  • Defined in src/worker/abstract-worker.ts:75
  • +
    + +
    taskFunctions: Map<string, TaskFunction<Data, Response>>
    +

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

    +
    +

    Methods

    -
    - -
    +
    + +
    +
    + +

    Parameters

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }

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

    Returns void

    -
    - -
    +
    + +

    Returns void

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

    Returns string

    The error message.

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

    Returns void

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

    The received message.

    +
    +
    +

    Returns void

    +
    +
    + + +

    Returns TaskFunctionOperationResult

    Whether the task function existed and was removed or not.

    + +
    -
    - -
    +
    + +
    +
    + + +
    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;
    }

    -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • activeInterval
  • +
  • id
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkActive
  • +
  • checkMessageWorkerId
  • +
  • checkStatistics
  • +
  • checkTaskFunctions
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • endTaskPerformance
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • handleTaskFunctionOperationMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctionNames
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionNamesToMainWorker
  • +
  • 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