X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=6878a4bdc812e786a5bb48f57f31b3597d1f9bb5;hb=6c525543a7ed67a926b7c1f4bf98985aaad1f088;hp=3aef097c782d69845b70b72ef371afc2cbf632de;hpb=2ad2e730485a924c6a03e6f6a1bc64b413b01527;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 3aef097c..6878a4bd 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier
+ClusterWorker | poolifier
-
+
@@ -83,7 +83,7 @@ but the minimum number of workers will be guaranteed.

    - +
  • Constructs a new poolifier cluster worker.

    @@ -98,28 +98,28 @@ 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

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

    aliveInterval?: Timeout

    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.

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

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

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

    Options for the worker.

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

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

    Returns

    The unique asyncId assigned to the resource.

    Returns number

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

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

      Parameters

      • -
        fn: Func
        +
        fn: Func

        The function to bind to the current AsyncResource.

      -

      Returns Func & {
          asyncResource: AsyncResource;
      }

    @@ -211,13 +211,13 @@ the AsyncResource to which the function is bound.

    Checks if the worker should be terminated, because its living too long.

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:146
    • - +
    • Call all destroy hooks. This should only ever be called once. An error will be thrown if it is called more than once. This must be manually called. If @@ -226,8 +226,8 @@ never be called.

      Returns

      A reference to asyncResource.

      -

      Returns ClusterWorker<Data, Response>

    @@ -240,29 +240,33 @@ never be called.

    Returns

    Reference to the main worker.

    Returns Worker

    +
  • Defined in src/worker/abstract-worker.ts:129
  • Returns string

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

    Returns Response

    Returns void

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

    Input data for the given function.

  • Returns void

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

    Returns void

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

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }