X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fclasses%2FThreadWorker.html;h=6c6183ddb4f7d9eb9cc078d84a4f51c5900e8aff;hb=e1d3eccbb484bfbe36f6dcb9c4ef22a11621a00b;hp=79298d41f4848667b9ed935730ebefbfadc2e688;hpb=42db2d3372ac49ab00dd1889378238b7a78ac4ce;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 79298d41..6c6183dd 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -40,11 +40,11 @@ but the minimum number of workers will be guaranteed.

Hierarchy

+
  • Defined in src/worker/thread-worker.ts:21
  • @@ -83,7 +83,7 @@ but the minimum number of workers will be guaranteed.

      - +
    • Constructs a new poolifier thread 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 ThreadWorker<Data, Response>

    +
  • Defined in src/worker/thread-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 | MessagePort

    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,9 +240,9 @@ never be called.

    Returns

    Reference to the main worker.

    Returns MessagePort

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

    +
  • Defined in src/worker/abstract-worker.ts:168
  • 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/thread-worker.ts:39
  • @@ -473,7 +475,7 @@ the AsyncResource to which the function is bound.

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

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