X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=c911b1944e91641252b9ce5f6ab3c2ec39640194;hb=13aa72e5091fcfe52dcd2acf1039091e1d55ea32;hp=1774dd266624f88e7fbb71582dfb40901600f099;hpb=0770fe626b2bb3212a1d73fa4764973ac92e241a;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 1774dd26..c911b194 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,59 @@ 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 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: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 | MessagePort

    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

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

    Returns

    Reference to the main worker.

    Returns MessagePort

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

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

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }