X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=3354dbc0f8105816480b1b052095f9659004bd70;hb=a8aeac440fb425585a0d597af86f616e648ae156;hp=335e4252dac1237f048dc92f375bc4db676c7ea2;hpb=ec06e4dd01adf7aa4bab470c59da42c19d863d0b;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 335e4252..3354dbc0 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,19 +519,34 @@ the AsyncResource to which the function is bound.