X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=aeebdf03a84fcfefec2db264917e30264e93c4a9;hb=761b0c73be0bf581f50a78123913f933bd405f52;hp=07db2b16cdbeacc1deae33360581b27427fb3668;hpb=21402562176f7550bcd9ba620cf551972fca6e98;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 07db2b16..aeebdf03 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,17 @@ 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

    @@ -127,41 +116,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:36
  • isMain: boolean

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

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

    Reference to main worker.

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

    Options for the worker.

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

    @@ -173,13 +162,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 +185,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 +200,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:156
    • - +
    • 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 +215,8 @@ never be called.

      Returns

      A reference to asyncResource.

      -

      Returns ClusterWorker<Data, Response>

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

    Returns

    Reference to the main worker.

    Returns Worker

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

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

    Returns void

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

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }