X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=c0e3ee918ae072f071bfa33972455448b4d000b9;hb=6be0ab6d5c78c8e91cc4668d3d03db95f15cbfab;hp=bf014c7de22dde23a93900e54c77018f549ad35d;hpb=6c7b620077f30f365d597b7fce35cfe5584c2702;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index bf014c7d..c0e3ee91 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,15 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier
-
+
-
+
  • poolifier
  • @@ -15,33 +17,37 @@

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

-
-
+
+
+

Type Parameters

-
    +
    • -

      MainWorker extends Worker | MessagePort

      +

      MainWorker extends Worker | MessagePort

      Type of main worker.

      -
    • +
+
  • -

    Data = unknown

    +

    Data = unknown

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

    -
  • +
    +
  • -

    Response = unknown

    +

    Response = unknown

    Type of response the worker sends back to the main worker. This can only be serializable data.

    -
  • + +

    Hierarchy

    @@ -49,318 +55,342 @@

    Constructors

    -
    - - -

    Returns AbstractWorker<MainWorker, Data, Response>

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

    -
    - -
    aliveInterval?: Timeout
    -

    Handler Id of the aliveInterval worker alive check.

    -
    +
    + +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MainWorker
    +
    + +
    mainWorker: undefined | null | MainWorker
    +

    Reference to main worker.

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

    Options for the worker.

    -
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation.

    +
    +
    +
  • Defined in src/worker/abstract-worker.ts:50
  • +
    + +
    taskFunctions: Map<string, WorkerFunction<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 TaskPerformance

    -
    - -
    +
    + +
    +
    + + -

    Returns void

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

    Input data for the given function.

    -
  • -

    Returns void

    -
    - -
    +
    + + +

    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

    - -
    +
  • constructor
  • +
  • aliveInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkAlive
  • +
  • checkTaskFunctions
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • endTaskPerformance
  • +
  • getMainWorker
  • +
  • getTaskFunction
  • +
  • handleError
  • +
  • messageListener
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendToMainWorker
  • +
  • triggerAsyncId
  • +
  • bind
  • + +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file