X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=857696e685f9b240467d9d780cee5d00be5e9514;hb=71d327d5587f0ce2b746ba33ec0cfbb3a0dc5d1b;hp=33a4e3aeeaa05f0a573c748f6ec36cccc4340358;hpb=8d1797ad15cb2d87ac3c9904ce6df3db45c0c742;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 33a4e3ae..857696e6 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,13 +1,13 @@ -ThreadWorker | poolifier
+ThreadWorker | poolifier - v2.7.4
-
+
  • The search index is not available
  • poolifier - v2.7.4 +
    @@ -21,22 +21,25 @@ it will send a termination request to its main thread.

    If you use a DynamicThreadPool the extra workers that were created will be terminated, but the minimum number of workers will be guaranteed.

    +
    +
    +

    Author

    Alessandro Pio Ardizio

    -

    Author

    Alessandro Pio Ardizio

    - -

    Since

    0.0.1

    +

    Since

    0.0.1

    -
    +

    Type Parameters

    -
      +
      • Data = unknown

        -

        Type of data this worker receives from pool's execution. This can only be serializable data.

        -
      • +

        Type of data this worker receives from pool's execution. This can only be structured-cloneable data.

        +
        +
      • Response = unknown

        -

        Type of response the worker sends back to the main thread. This can only be serializable data.

        -
    +

    Type of response the worker sends back to the main thread. This can only be structured-cloneable data.

    +
    +

    Hierarchy

      @@ -44,52 +47,67 @@ but the minimum number of workers will be guaranteed.

      • ThreadWorker
    +
  • Defined in src/worker/thread-worker.ts:26
  • - +

    Constructors

    - +
      - +
    • Constructs a new poolifier thread worker.

      -
      +

      Type Parameters

      -
        +
        • Data = unknown

        • @@ -98,87 +116,148 @@ but the minimum number of workers will be guaranteed.

          Parameters

          • -
            fn: WorkerFunction<Data, Response>
            -

            Function processed by the worker when the pool's execution function is invoked.

            -
          • +
            taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>
            +

            Task function(s) processed by the worker when the pool's execution function is invoked.

            +
            +
          • opts: WorkerOptions = {}

            Options for the worker.

            -
    -

    Returns ThreadWorker<Data, Response>

    +
    +

    Returns ThreadWorker<Data, Response>

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

    -
    - -
    aliveInterval?: Timeout
    -

    Handler id of the aliveInterval worker alive check.

    -
    - +
    isMain: boolean

    Whether this is the main worker or not.

    -
    +
  • Defined in src/worker/abstract-worker.ts:91
  • - +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MessagePort
    -

    Reference to main worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:71
  • - -
    opts: WorkerOptions = ...
    + +
    opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

    Options for the worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:94
  • +
    + +
    port: MessagePort
    +

    Message port used to communicate with the main worker.

    +
    +
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

    +
    +
    +
    + +
    taskFunctions: Map<string, TaskFunction<Data, Response>>
    +

    Task function(s) processed by the worker when the pool's execution function is invoked.

    +
    +
    +
    +

    Accessors

    +
    + +

    Methods

    +
    + +
    - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.6.5/node_modules/@types/node/async_hooks.d.ts:315
  • - + -

    Returns Func & {
        asyncResource: AsyncResource;
    }

    -
    - - +

    Returns Func

    +
    +

    Since

    v14.8.0, v12.19.0

    +
    +
  • Defined in node_modules/.pnpm/@types+node@20.6.5/node_modules/@types/node/async_hooks.d.ts:288
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.6.5/node_modules/@types/node/async_hooks.d.ts:311
  • - +
    -
    - -
    +
    + + +

    Returns string

    The error message.

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

    +
  • Defined in src/worker/thread-worker.ts:89
  • +
    + +
    - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.6.5/node_modules/@types/node/async_hooks.d.ts:319
  • - +
    -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • activeInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • opts
  • +
  • port
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • id
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • bind
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • handleTaskFunctionOperationMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctionNames
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionNamesToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • triggerAsyncId
  • +
  • bind
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file