X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=6878a4bdc812e786a5bb48f57f31b3597d1f9bb5;hb=6c525543a7ed67a926b7c1f4bf98985aaad1f088;hp=22d281637b8f3eceba13438dbcc4fe3f25125fd8;hpb=f1583b4edd427f8c3f2b4ddc652d2e102390b08e;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 22d28163..6878a4bd 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,46 @@ but the minimum number of workers will be guaranteed.

      Parameters

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

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

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

            • -
              data: Data
            -

            Returns Response

      • +
        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:31
  • +
    + +
    isMain: boolean
    +

    Whether this is the main worker or not.

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

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

    Options for the worker.

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

    @@ -162,11 +175,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:146
  • +
  • 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:129
  • +
  • Defined in src/worker/cluster-worker.ts:47
  • +

    Returns Response

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:84
  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:171
  • -
    value: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

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