X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=48dfe83b952cbd0d9165f335252bb39938c52f6d;hb=699db3f06500e28320ae786e304c23020dd5b5ad;hp=eb4a625ef37c0082bf523dc866538d150e8f56bc;hpb=3aaed019abde0022e986c1db05db9d5d7bc76594;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index eb4a625e..48dfe83b 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,4 +1,4 @@ -ThreadWorker | poolifier
+ThreadWorker | poolifier
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier
    -
    +
    @@ -57,9 +57,10 @@ but the minimum number of workers will be guaranteed.

    Properties

    Methods

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

      - +
    • Constructs a new poolifier thread worker.

      @@ -97,60 +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.

    +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    +
  • Defined in src/worker/abstract-worker.ts:32
  • -
    mainWorker: undefined | null | MessagePort
    -
    - - +
  • Defined in src/worker/abstract-worker.ts:50
  • +
    + +
    opts: WorkerOptions = ...

    Options for the worker.

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

    @@ -162,13 +162,13 @@ but the minimum number of workers will be guaranteed.

    Returns

    The unique asyncId assigned to the resource.

    Returns number

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:315
    • - +
    • Binds the given function to execute to this AsyncResource's scope.

      The returned function will have an asyncResource property referencing @@ -185,13 +185,13 @@ the AsyncResource to which the function is bound.

      Parameters

      • -
        fn: Func
        +
        fn: Func

        The function to bind to the current AsyncResource.

      -

      Returns Func & {
          asyncResource: AsyncResource;
      }

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:288
    • @@ -200,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
    • - +
    • Call all destroy hooks. This should only ever be called once. An error will be thrown if it is called more than once. This must be manually called. If @@ -215,10 +215,10 @@ never be called.

      Returns

      A reference to asyncResource.

      -

      Returns ThreadWorker<Data, Response>

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:311
    • @@ -229,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

    +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:303
  • Returns void

    +
  • Defined in src/worker/thread-worker.ts:39
  • +
  • Defined in node_modules/.pnpm/@types+node@18.15.11/node_modules/@types/node/async_hooks.d.ts:320
  • Parameters

    -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    +
    +
    -
    +
  • constructor
  • +
  • aliveInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • asyncId
  • +
  • bind
  • +
  • checkAlive
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • messageListener
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • sendToMainWorker
  • +
  • triggerAsyncId
  • +
  • bind
  • + +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file