X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=4476d945541582990753b0308c10eb69adf28196;hb=f63918da6f3fc77cc7f98e4d43e3f37955140468;hp=846e4c32efb8979cf0772db1f0bd5808ed6e0aca;hpb=42db2d3372ac49ab00dd1889378238b7a78ac4ce;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 846e4c32..4476d945 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -40,11 +40,11 @@ but the minimum number of workers will be guaranteed.

Hierarchy

+
  • Defined in src/worker/cluster-worker.ts:21
  • @@ -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 | Promise<Response>)

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

          • -
          • (data: Data): Response
          • +
          • (data: Data): Response | Promise<Response>
          • Parameters

            • data: Data
            -

            Returns Response

      • +

        Returns Response | Promise<Response>

  • opts: WorkerOptions = {}

    Options for the worker.

  • Returns ClusterWorker<Data, Response>

    +
  • Defined in src/worker/cluster-worker.ts:31
  • 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,7 +173,7 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

    @@ -200,7 +200,7 @@ the AsyncResource to which the function is bound.

    The function to bind to the current AsyncResource.

    Returns Func & {
        asyncResource: AsyncResource;
    }

    @@ -211,9 +211,9 @@ 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:153
  • @@ -240,29 +240,33 @@ never be called.

    Returns

    Reference to the main worker.

    Returns Worker

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

    +
  • Defined in src/worker/cluster-worker.ts:50
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:84
  • Returns Response

  • -
    message: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:178
  • Returns Promise<Response>

  • -
    message: MessageValue<Data, unknown>
    +
    message: MessageValue<Data, unknown>

    Input data for the given function.

  • Returns void

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

    Returns void

    +
  • Defined in src/worker/cluster-worker.ts:45
  • @@ -469,7 +475,7 @@ the AsyncResource to which the function is bound.

  • Optional thisArg: ThisArg
  • Returns Func & {
        asyncResource: AsyncResource;
    }

    @@ -513,21 +519,34 @@ the AsyncResource to which the function is bound.