X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=030c1b5f6b762015b978527bb69177bb71166045;hb=761b0c73be0bf581f50a78123913f933bd405f52;hp=9b927050c92b56b9aa478fb413bef381f9bde915;hpb=ec06e4dd01adf7aa4bab470c59da42c19d863d0b;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 9b927050..030c1b5f 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,17 @@ 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>

    +
  • Defined in src/worker/thread-worker.ts:31
  • Properties

    @@ -127,41 +116,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: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,7 +162,7 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

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

    The function to bind to the current AsyncResource.

    Returns Func & {
        asyncResource: AsyncResource;
    }

    @@ -211,9 +200,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: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
  • Returns Result

    Returns void

    +
  • Defined in src/worker/thread-worker.ts:39
  • @@ -473,7 +431,7 @@ the AsyncResource to which the function is bound.

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

    @@ -517,26 +475,44 @@ the AsyncResource to which the function is bound.