X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=c3a79eecdf9d5a71e8b0258e53321f43a4f97bbf;hb=4cb259d3e1837759b8bac901d3755f1610b5ddc4;hp=18a43c17ff5ece1893951dc02c853071665114b0;hpb=749e1fa387ba832c85f789337b3c2e679331cb64;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 18a43c17..c3a79eec 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,13 +1,13 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier - v2.6.42
-
+
  • The search index is not available
  • poolifier - v2.6.42 +
    @@ -17,22 +17,26 @@

    Class AbstractWorker<MainWorker, Data, Response>Abstract

    Base class that implements some shared logic for all poolifier workers.

    -
    +
    +

    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 worker. This can only be serializable data.

    -
  • +

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

    +
    +

    Hierarchy

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

    Constructors

    - + +

    Returns AbstractWorker<MainWorker, Data, Response>

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

    -
    - -
    aliveInterval?: Timeout
    -

    Handler id of the aliveInterval worker alive check.

    -
    +
    + +
    id: number
    +

    Worker id.

    +
    +
    - +
    isMain: boolean

    Whether this is the main worker or not.

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

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MainWorker
    +
  • 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.

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

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

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

    Returns Func & {
        asyncResource: AsyncResource;
    }

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

    Returns void

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

    Returns void

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

    Returns string

    Message of the error.

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

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

    Returns void

    +
    +
  • Defined in src/worker/abstract-worker.ts:541
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.9/node_modules/@types/node/async_hooks.d.ts:294
  • +
    + +
    +
    + +
    - + +

    Returns void

    +
    +
  • Defined in src/worker/abstract-worker.ts:446
  • +
    + +
    +
    + +
    +
    + +
    - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.9/node_modules/@types/node/async_hooks.d.ts:311
  • +
    + +
    - + -

    Returns Func & {
        asyncResource: AsyncResource;
    }

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

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • activeInterval
  • +
  • id
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkActive
  • +
  • checkMessageWorkerId
  • +
  • checkStatistics
  • +
  • checkTaskFunctionName
  • +
  • checkTaskFunctions
  • +
  • checkValidTaskFunction
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • endTaskPerformance
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctions
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionsListToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • startCheckActive
  • +
  • stopCheckActive
  • +
  • triggerAsyncId
  • +
  • updateLastTaskTimestamp
  • +
  • bind
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file