X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=c6b9b8d3869994a2ef44a7c5eff88f01dfce4bd2;hb=5ee29ca61ee790da371ad3a83fc7b9c79fb02de2;hp=538b95a98177a482782455e3fd798bf90d7c9508;hpb=177be4a662e85919499d34984db6c77c6e5da5f6;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index 538b95a9..c6b9b8d3 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,13 +1,13 @@ -ThreadWorker | poolifier - v2.6.16
+ThreadWorker | poolifier - v2.7.0
-
+
  • The search index is not available
  • poolifier - v2.7.0 +
    @@ -47,46 +47,50 @@ but the minimum number of workers will be guaranteed.

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

    Constructors

    -

    Properties

    -

    Accessors

    -
    id +

    Methods

    -
    addTaskFunction +
    addTaskFunction asyncId bind emitDestroy getMainWorker handleError +handleKillMessage +handleReadyMessage +handleTaskFunctionOperationMessage hasTaskFunction +listTaskFunctionNames messageListener removeTaskFunction run runAsync runInAsyncScope runSync -sendReadyResponse +sendTaskFunctionNamesToMainWorker sendToMainWorker setDefaultTaskFunction triggerAsyncId @@ -95,7 +99,7 @@ but the minimum number of workers will be guaranteed.

    Constructors

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

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

    +
  • Defined in src/worker/abstract-worker.ts:74
  • isMain: boolean
    @@ -145,7 +149,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:86
  • lastTaskTimestamp: number
    @@ -154,25 +158,24 @@ but the minimum number of workers will be guaranteed.

    -
    - -
    mainWorker: MessagePort
    -

    Reference to main worker.

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

    Options for the worker.

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

    Message port used to communicate with the main worker.

    +
    +
    statistics: WorkerStatistics
    @@ -181,16 +184,16 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:70
  • -
    taskFunctions: Map<string, WorkerFunction<Data, Response>>
    +
    taskFunctions: Map<string, TaskFunction<Data, Response>>

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

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

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

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

      - +
    • Adds a task function to the worker. If a task function with the same name already exists, it is replaced.

      @@ -224,22 +227,16 @@ If a task function with the same name already exists, it is replaced.

    • -
      fn: WorkerFunction<Data, Response>
      +
      fn: TaskFunction<Data, Response>

      The task function to add.

    -

    Returns boolean

    Whether the task function was added or not.

    - -
    -

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string.

    +

    Returns TaskFunctionOperationResult

    Whether the task function was added or not.

    -

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the default task function reserved name.

    - -

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the fn parameter is not a function.

    -
      @@ -250,7 +247,7 @@ If a task function with the same name already exists, it is replaced.

    +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:307
    • @@ -277,7 +274,7 @@ If a task function with the same name already exists, it is replaced.

    +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:284
  • +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:303
  • Returns MessagePort

    Reference to the main worker.

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

    Returns boolean

    Whether the worker has a task function with the given name or not.

    +

    Returns TaskFunctionOperationResult

    Whether the worker has a task function with the given name or not.

    -
    -

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string.

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

    Returns boolean

    Whether the task function existed and was removed or not.

    - -
    -

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string.

    +

    Returns TaskFunctionOperationResult

    Whether the task function existed and was removed or not.

    -

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the default task function reserved name.

    - -

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the task function used as default task function.

    -
    +
  • Defined in src/worker/abstract-worker.ts:256
  • +
  • Defined in src/worker/abstract-worker.ts:539
  • +
  • Defined in src/worker/abstract-worker.ts:600
  • +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:295
  • -
    - +
  • Defined in src/worker/abstract-worker.ts:566
  • +
    +
    +
  • Defined in src/worker/abstract-worker.ts:517
  • +
  • Defined in src/worker/thread-worker.ts:89
  • -

    Returns boolean

    Whether the default task function was set or not.

    - -
    -

    Throws

    https://nodejs.org/api/errors.html#class-typeerror If the name parameter is not a string.

    - -

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is the default task function reserved name.

    +

    Returns TaskFunctionOperationResult

    Whether the default task function was set or not.

    -

    Throws

    https://nodejs.org/api/errors.html#class-error If the name parameter is a non-existing task function.

    -
    +
  • Defined in src/worker/abstract-worker.ts:312
  • +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:312
  • +
  • Defined in node_modules/.pnpm/@types+node@20.6.2/node_modules/@types/node/async_hooks.d.ts:278
  • @@ -654,8 +706,8 @@ then restore the original execution context.

  • activeInterval
  • isMain
  • lastTaskTimestamp
  • -
  • mainWorker
  • opts
  • +
  • port
  • statistics
  • taskFunctions
  • id
  • @@ -665,80 +717,47 @@ then restore the original execution context.

  • emitDestroy
  • getMainWorker
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • handleTaskFunctionOperationMessage
  • hasTaskFunction
  • +
  • listTaskFunctionNames
  • messageListener
  • removeTaskFunction
  • run
  • runAsync
  • runInAsyncScope
  • runSync
  • -
  • sendReadyResponse
  • +
  • sendTaskFunctionNamesToMainWorker
  • sendToMainWorker
  • setDefaultTaskFunction
  • triggerAsyncId
  • bind
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file