X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=aeebdf03a84fcfefec2db264917e30264e93c4a9;hb=761b0c73be0bf581f50a78123913f933bd405f52;hp=22d281637b8f3eceba13438dbcc4fe3f25125fd8;hpb=301c53e7ae6cf1120298ea10868a9091904c01a2;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 22d28163..aeebdf03 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,13 +1,15 @@ -ClusterWorker | poolifier
+ClusterWorker | poolifier
-
+
-
+
  • poolifier
  • @@ -20,10 +22,6 @@ 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.

    -

    Template

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

    - -

    Template

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

    -

    Author

    Christopher Quadflieg

    Since

    2.0.0

    @@ -32,17 +30,21 @@ but the minimum number of workers will be guaranteed.

    Type Parameters

    • -

      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

+
  • Defined in src/worker/cluster-worker.ts:21
  • @@ -55,9 +57,10 @@ but the minimum number of workers will be guaranteed.

    Properties

    Methods

    @@ -80,7 +83,7 @@ but the minimum number of workers will be guaranteed.

      - +
    • Constructs a new poolifier cluster worker.

      @@ -95,38 +98,35 @@ but the minimum number of workers will be guaranteed.

      Parameters

      • -
        fn: ((data: Data) => Response)
        +
        fn: WorkerFunction<Data, Response>

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

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

            Parameters

            -
              -
            • -
              data: Data
            -

            Returns Response

      • +
  • opts: WorkerOptions = {}

    Options for the worker.

  • -

    Returns ClusterWorker<Data, Response>

    Properties

    aliveInterval?: Timeout
    -

    Handler Id of the aliveInterval worker alive check.

    +

    Handler id of the aliveInterval worker alive check.

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

    Whether this is the main worker or not.

    +
    lastTaskTimestamp: number
    @@ -134,21 +134,23 @@ but the minimum number of workers will be guaranteed.

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

    Options for the worker.

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

    @@ -162,11 +164,11 @@ but the minimum number of workers will be guaranteed.

    Returns number

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:315
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:288
  • +
  • Defined in src/worker/abstract-worker.ts:156
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:311
  • +
  • Defined in src/worker/abstract-worker.ts:139
  • +
  • Defined in src/worker/cluster-worker.ts:50
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:89
  • +
  • Defined in src/worker/abstract-worker.ts:181
  • +
  • Defined in src/worker/abstract-worker.ts:208
  • -
    Optional thisArg: This
    +
    Optional thisArg: This

    The receiver to be used for the function call.

  • Rest ...args: any[]

    Optional arguments to pass to the function.

  • -

    Returns Result

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:303
  • +
  • Defined in src/worker/cluster-worker.ts:45
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:320
  • Parameters

    -

    Returns Func & { asyncResource: AsyncResource }

    +
    +
    -
    +
  • constructor
  • +
  • aliveInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • asyncId
  • +
  • bind
  • +
  • checkAlive
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • messageListener
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • sendToMainWorker
  • +
  • triggerAsyncId
  • +
  • bind
  • + +

    Generated using TypeDoc

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