X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=d01ac89f93063843087ec0adbbed184d06ff3d76;hb=51e49c70379025e6709ae33e5cb4bf91b22ccc41;hp=c6f0e017c55b51b56e5f60c9de6c572ae8a826bc;hpb=b45edd35eec0fb1d5fd8fa979ff00f17f4e3c24e;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index c6f0e017..d01ac89f 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,13 +1,13 @@ -ClusterWorker | poolifier
+ClusterWorker | poolifier - v2.7.1
-
+
  • The search index is not available
  • poolifier - v2.7.1 +
    @@ -21,542 +21,731 @@ it will send a termination request to its main worker.

    If you use a DynamicClusterPool the extra workers that were created will be terminated, but the minimum number of workers will be guaranteed.

    +
    +
    +

    Author

    Christopher Quadflieg

    -

    Author

    Christopher Quadflieg

    - -

    Since

    2.0.0

    +

    Since

    2.0.0

    -
    +

    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

    +
  • Defined in src/worker/cluster-worker.ts:21
  • - +

    Constructors

    -
    - -
      - +
      + +
        +
      • Constructs a new poolifier cluster worker.

        -
        +

        Type Parameters

        -
          +
          • -

            Data = unknown

          • +

            Data = unknown

          • -

            Response = unknown

        +

        Response = unknown

      Parameters

      • -
        fn: ((data: Data) => Response)
        -

        Function processed by the worker when the pool's execution function is invoked.

        +
        taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>
        +

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

        -
          -
        • -
            -
          • (data: Data): Response
          • -
          • -
            -

            Parameters

            -
              -
            • -
              data: Data
            -

            Returns Response

      • +
      • -
        opts: WorkerOptions = {}
        +
        opts: WorkerOptions = {}

        Options for the worker.

        -
      -

      Returns ClusterWorker<Data, Response>

    +
    +

    Returns ClusterWorker<Data, Response>

    +
    +
  • Defined in src/worker/cluster-worker.ts:31
  • 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 | Worker
    -

    Reference to main worker.

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

    Options for the worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:94
  • +
    + +
    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.

    +
    +
    +
    +

    Accessors

    +
    + +

    Methods

    -
    - -
    +
    + +

    Parameters

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    -
    - - +

    Returns Func

    +
    +

    Since

    v14.8.0, v12.19.0

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

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

    +

    Theme

    -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • activeInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • id
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • bind
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • handleTaskFunctionOperationMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctionNames
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionNamesToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • triggerAsyncId
  • +
  • bind
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file