X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=bfe188791e4dc2f0d189ef6f771c0619f92d3c29;hb=a6b5c73ccccb3ef0ccc24ad462182e3cacee77b4;hp=84080253a830356f30b79ad89cc127846d39190e;hpb=ffc8d14415d44de881ee66ee60fc74da48084976;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 84080253..f0cdd40c 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier
+ClusterWorker | poolifier - v2.6.9
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.9
    -
    +
    • poolifier
    • @@ -21,30 +21,33 @@ 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

      -
    • AbstractWorker<Worker, Data, Response> +
    • AbstractWorker<Worker, Data, Response>
      • ClusterWorker
    +
  • Defined in src/worker/cluster-worker.ts:21
  • @@ -52,283 +55,264 @@ but the minimum number of workers will be guaranteed.

    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: WorkerFunction<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
    +
    + +
    aliveInterval?: Timeout

    Handler id of the aliveInterval worker alive check.

    -
    +
    -
    - -
    isMain: boolean
    +
  • Defined in src/worker/abstract-worker.ts:58
  • +
    + +
    isMain: boolean

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

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

    Options for the worker.

    -
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

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

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

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

    Methods

    -
    - -
      - +

      Accessors

      +
      + +
        +
      • get id(): number
      • -
        -

        Returns

        The unique asyncId assigned to the resource.

        +

        Worker id.

        -

        Returns number

      -
      - -
    +
    +

    Methods

    +
    + +
      +
    • -

      Binds the given function to execute to this AsyncResource's scope.

      -

      The returned function will have an asyncResource property referencing -the AsyncResource to which the function is bound.

      +

      Returns number

      The unique asyncId assigned to the resource.

      -

      Since

      v14.8.0, v12.19.0

      +
    +
    + +
      + +
    • +

      Binds the given function to execute to this AsyncResource's scope.

      -
      +

      Type Parameters

      -
        +
        • -

          Func extends ((...args: any[]) => any)

      +

      Func extends ((...args) => any)

    Parameters

    • -
      fn: Func
      +
      fn: Func

      The function to bind to the current AsyncResource.

      -
    -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    -
    - - +

    Returns Func

    +
    +

    Since

    v14.8.0, v12.19.0

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

    Returns string

    The error message.

    + +
    -
    - -
    +
    + + +

    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
  • +
  • id
  • +
  • asyncId
  • +
  • bind
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • messageListener
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendToMainWorker
  • +
  • triggerAsyncId
  • +
  • bind
  • + +

    Generated using TypeDoc

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