X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=1ecc9fd9de18ddeed0766056183d7ce25fcbb3aa;hb=e39450c0889208d6dcde666fc05b95fe7a98ee29;hp=244e40526a4afc70ef0d33cae00a52f86d54efd2;hpb=e604957d6ec7c137a3588de2ebbc9c83c0f634ba;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 244e4052..1ecc9fd9 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier
+ThreadWorker | poolifier
-
+
@@ -60,7 +60,7 @@ but the minimum number of workers will be guaranteed.

isMain lastTaskTimestamp mainWorker -opts +opts

Methods

@@ -83,7 +83,7 @@ but the minimum number of workers will be guaranteed.

    - +
  • Constructs a new poolifier thread worker.

    @@ -98,70 +98,70 @@ 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 ThreadWorker<Data, Response>

    Properties

    aliveInterval?: Timeout
    -

    Handler Id of the aliveInterval worker alive check.

    +

    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,13 +173,13 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

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

    Returns

    Reference to the main worker.

    Returns MessagePort

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

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

    Returns Response

    Returns void

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

    Input data for the given function.

  • Returns void

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

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }