X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=f36ce844060615ddc3518fec3c6d085b0faf3983;hb=999ef664722a6ef639e3b3a90542e3ed2f38288c;hp=6ecd85f062a20f06edbed633a0c88ae250e2e1c5;hpb=120c7852afd1ce4c01bd7e70cd14eeeedda8c1e3;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 6ecd85f0..f36ce844 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,4 +1,4 @@ -AbstractWorker | poolifier - v2.6.16
+AbstractWorker | poolifier - v2.6.36
  • Preparing search index...
  • -
  • The search index is not available
poolifier - v2.6.16
+
  • The search index is not available
  • poolifier - v2.6.36
    @@ -103,7 +108,7 @@
      - +
    • Constructs a new poolifier worker.

      @@ -111,7 +116,7 @@

      Type Parameters

      • -

        MainWorker extends Worker | MessagePort

      • +

        MainWorker extends MessagePort | Worker

      • Data = unknown

      • @@ -122,33 +127,28 @@
      • type: string

        The type of async event.

        -
        -
      • +
      • isMain: boolean

        Whether this is the main worker or not.

        -
        -
      • -
      • -
        taskFunctions: WorkerFunction<Data, Response> | TaskFunctions<Data, Response>
        -

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

        -
        -
      • +
      • mainWorker: MainWorker

        Reference to main worker.

        -
        -
      • +
      • -
        opts: WorkerOptions = ...
        +
        taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>
        +

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

        +
      • +
      • +
        opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

        Options for the worker.

        -
        -
      +

    Returns AbstractWorker<MainWorker, Data, Response>

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

    @@ -158,7 +158,7 @@
    +
  • Defined in src/worker/abstract-worker.ts:73
  • id: number
    @@ -166,7 +166,7 @@
    +
  • Defined in src/worker/abstract-worker.ts:57
  • isMain: boolean
    @@ -174,7 +174,7 @@
    +
  • Defined in src/worker/abstract-worker.ts:85
  • lastTaskTimestamp: number
    @@ -182,23 +182,23 @@
    -
    - +
  • Defined in src/worker/abstract-worker.ts:65
  • +
    +
    mainWorker: MainWorker

    Reference to main worker.

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

    Options for the worker.

    +
  • Defined in src/worker/abstract-worker.ts:88
  • statistics: WorkerStatistics
    @@ -206,15 +206,15 @@
    +
  • Defined in src/worker/abstract-worker.ts:69
  • -
    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:61
  • Methods

    @@ -231,24 +231,22 @@ If a task function with the same name already exists, it is replaced.

  • name: string

    The name of the task function to add.

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

    +

    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.

    Throws

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

    +
  • Defined in src/worker/abstract-worker.ts:186
  • +
  • Defined in node_modules/.pnpm/@types+node@20.5.6/node_modules/@types/node/async_hooks.d.ts:306
  • Returns TaskPerformance

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

    Returns Func

    Since

    v14.8.0, v12.19.0

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.6/node_modules/@types/node/async_hooks.d.ts:283
  • +
  • Defined in src/worker/abstract-worker.ts:412
  • +
    + +
    +
  • Defined in src/worker/abstract-worker.ts:592
  • +
    + +

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:111
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:101
  • +
  • Defined in node_modules/.pnpm/@types+node@20.5.6/node_modules/@types/node/async_hooks.d.ts:302
  • Returns TaskPerformance

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

    Returns string

    The error message.

    -
    -

    Throws

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

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

    Returns string

    The error message.

    - +
    +

    Parameters

    +
      +
    • +
      message: MessageValue<Data, unknown>
      +

      The ready message.

      +
    +

    Returns void

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

    Returns boolean

    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.

    +

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

    Returns void

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

    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.

    +

    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.

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

    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:468
  • Returns void

    +
  • Defined in src/worker/abstract-worker.ts:533
  • 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.5.6/node_modules/@types/node/async_hooks.d.ts:294
  • Returns void

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

    Returns void

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

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

    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:278
  • +
  • Defined in src/worker/abstract-worker.ts:391
  • +
  • Defined in src/worker/abstract-worker.ts:402
  • +
  • Defined in node_modules/.pnpm/@types+node@20.5.6/node_modules/@types/node/async_hooks.d.ts:311
  • +
    + +
    +
    Optional thisArg: ThisArg
    Optional

    Returns Func

    Since

    v14.8.0, v12.19.0

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

    Generated using TypeDoc

    +

    Generated using TypeDoc

    \ No newline at end of file