X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=efddf4c5c40c99d1755656aaead75ab2853fd374;hb=ba92b02f642f229cb927ab526148f10107831471;hp=f5c6ec9c0f571b7a7546c2bf582a41eb214a4a86;hpb=248bc34b348a7d8d2b90eecff49d60a3b465da9e;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index f5c6ec9c..efddf4c5 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,11 +1,13 @@ ClusterWorker | 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

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

    Properties

    aliveInterval? +isMain lastTaskTimestamp mainWorker opts @@ -114,9 +117,9 @@ but the minimum number of workers will be guaranteed.

    Options for the worker.

    Returns ClusterWorker<Data, Response>

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

    @@ -124,31 +127,41 @@ but the minimum number of workers will be guaranteed.

    aliveInterval?: Timeout

    Handler Id of the aliveInterval worker alive check.

    +
    + +
    isMain: boolean
    +

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

    +
  • Defined in src/worker/abstract-worker.ts:27
  • -
    mainWorker: undefined | null | Worker
    +
  • Defined in src/worker/abstract-worker.ts:49
  • Options for the worker.

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

    @@ -160,13 +173,13 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:315
    • - +
    • Binds the given function to execute to this AsyncResource's scope.

      The returned function will have an asyncResource property referencing @@ -186,21 +199,21 @@ the AsyncResource to which the function is bound.

      fn: Func

      The function to bind to the current AsyncResource.

    -

    Returns Func & { asyncResource: AsyncResource }

    +
  • Defined in src/worker/abstract-worker.ts:143
  • Returns ClusterWorker<Data, Response>

    +
  • 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:126
  • Returns string

    +
  • Defined in src/worker/cluster-worker.ts:47
  • Returns Response

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:80
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:168
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:191
  • Returns Result

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:303
  • Returns void

    +
  • 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
  • -

    Returns Func & { asyncResource: AsyncResource }

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:273