X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FThreadWorker.html;h=a15f46f527a74b6c6733a7a591215d6ab233eb07;hb=1ed7fb6c99f2fcb5f319d9c1fa2aefc5434f82e4;hp=c826b6784bee945bd6082c5d0a817503019dfd03;hpb=323daa7f98fd16385379e4b6e8def0a9a3f140c8;p=poolifier.git diff --git a/docs/classes/ThreadWorker.html b/docs/classes/ThreadWorker.html index c826b678..a15f46f5 100644 --- a/docs/classes/ThreadWorker.html +++ b/docs/classes/ThreadWorker.html @@ -1,13 +1,13 @@ -ThreadWorker | poolifier - v2.6.36
+ThreadWorker | poolifier - v3.0.2
-
+
  • The search index is not available
  • poolifier - v3.0.2 +
    @@ -47,19 +47,19 @@ but the minimum number of workers will be guaranteed.

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

    Constructors

    -

    Properties

    -
    activeInterval? +
    activeInterval? isMain lastTaskTimestamp opts @@ -69,11 +69,11 @@ but the minimum number of workers will be guaranteed.

    Accessors

    -
    id +

    Methods

    -
    addTaskFunction +
    addTaskFunction asyncId bind emitDestroy @@ -81,15 +81,16 @@ but the minimum number of workers will be guaranteed.

    handleError handleKillMessage handleReadyMessage +handleTaskFunctionOperationMessage hasTaskFunction -listTaskFunctions +listTaskFunctionNames messageListener removeTaskFunction run runAsync runInAsyncScope runSync -sendTaskFunctionsListToMainWorker +sendTaskFunctionNamesToMainWorker sendToMainWorker setDefaultTaskFunction triggerAsyncId @@ -98,7 +99,7 @@ but the minimum number of workers will be guaranteed.

    Constructors

    - +
    • @@ -117,16 +118,18 @@ but the minimum number of workers will be guaranteed.

    • 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>

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

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

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

    +
  • Defined in src/worker/abstract-worker.ts:91
  • lastTaskTimestamp: number
    @@ -155,7 +158,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:71
  • opts: WorkerOptions = DEFAULT_WORKER_OPTIONS
    @@ -164,7 +167,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:94
  • port: MessagePort
    @@ -172,7 +175,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/thread-worker.ts:33
  • statistics: WorkerStatistics
    @@ -181,7 +184,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:75
  • taskFunctions: Map<string, TaskFunction<Data, Response>>
    @@ -190,7 +193,7 @@ but the minimum number of workers will be guaranteed.

    +
  • Defined in src/worker/abstract-worker.ts:67
  • 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.

      @@ -221,23 +224,19 @@ If a task function with the same name already exists, it is replaced.

    • name: string

      The name of the task function to add.

      -
    • +
    +
  • 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 or an empty 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 task function was added or not.

    -

    Throws

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

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

    Returns Func

    Since

    v14.8.0, v12.19.0

    +
  • Defined in node_modules/.pnpm/@types+node@20.8.6/node_modules/@types/node/async_hooks.d.ts:288
  • +
  • Defined in node_modules/.pnpm/@types+node@20.8.6/node_modules/@types/node/async_hooks.d.ts:311
  • +
  • Defined in src/worker/abstract-worker.ts:454
  • Returns string

    The error message.

    +
  • Defined in src/worker/thread-worker.ts:97
  • Returns void

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

    Returns void

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

    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 or an empty string.

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

    Returns void

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

    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 or an empty 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 task function existed and was removed or not.

    -

    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:214
  • + +

    Returns void

    -
    -

    Throws

    https://nodejs.org/api/errors.html#class-error If the task function is not found.

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

    Returns void

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

    The receiver to be used for the function call.

    -
    Optional
  • + +
  • Rest ...args: any[]

    Optional arguments to pass to the function.

    -
    Rest
  • + +

    Returns Result

    Since

    v9.6.0

    +
  • Defined in node_modules/.pnpm/@types+node@20.8.6/node_modules/@types/node/async_hooks.d.ts:299
  • + +

    Returns void

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

    Returns void

    +
  • 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 or an empty 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:270
  • +
  • Defined in node_modules/.pnpm/@types+node@20.8.6/node_modules/@types/node/async_hooks.d.ts:319
  • +
    Optional thisArg: ThisArg

    Returns Func

    Since

    v14.8.0, v12.19.0

    +
  • Defined in node_modules/.pnpm/@types+node@20.8.6/node_modules/@types/node/async_hooks.d.ts:278
  • +

    Generated using TypeDoc

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