X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=84fd102e762555d9ae11b48f168441ddfc2092d4;hb=0e16e60a89029abe61cda7ba293c036298cced05;hp=b1134c0258f8f3382de1f4fc5cf85afb20a8c81a;hpb=70353024c44987c467dadcec306c699ce4ae1f06;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index b1134c02..84fd102e 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,4 +1,4 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier - v2.6.26
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.26
    @@ -17,22 +17,26 @@

    Class AbstractWorker<MainWorker, Data, Response>Abstract

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

    -
    +
    +

    Type Parameters

    +

    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:39
  • @@ -51,42 +55,59 @@

    Constructors

    - +
      - +
    • Constructs a new poolifier worker.

      @@ -94,7 +115,7 @@

      Type Parameters

      • -

        MainWorker extends Worker | MessagePort

      • +

        MainWorker extends MessagePort | Worker

      • Data = unknown

      • @@ -105,92 +126,163 @@
      • 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: undefined | null | MainWorker
        +
        mainWorker: MainWorker

        Reference to main worker.

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

        Options for the worker.

        -
      -

      Returns AbstractWorker<MainWorker, Data, Response>

    +

    Returns AbstractWorker<MainWorker, Data, Response>

    +
    +
  • Defined in src/worker/abstract-worker.ts:73
  • 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:75
  • - +
    lastTaskTimestamp: number

    Timestamp of the last task processed by this worker.

    -
    -
    - -
    mainWorker: undefined | null | MainWorker
    +
  • Defined in src/worker/abstract-worker.ts:55
  • +
    + +
    mainWorker: MainWorker

    Reference to main worker.

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

    Options for the worker.

    -
    +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

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

    +
    + +
    - +
      - +
    • -

      Returns number

      The unique asyncId assigned to the resource.

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

    Returns Func

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

    Returns void

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

    Returns void

    +
  • Defined in src/worker/abstract-worker.ts:102
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.0/node_modules/@types/node/async_hooks.d.ts:302
  • +
    + +
    - +
    +
  • Defined in src/worker/abstract-worker.ts:415
  • - + +

    Returns TaskFunction<Data, Response>

    The task function.

    + +
    +

    Throws

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

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

    Returns string

    Message of the error.

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns Func

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.0/node_modules/@types/node/async_hooks.d.ts:277
  • +
  • constructor
  • +
  • activeInterval
  • +
  • id
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkActive
  • +
  • checkStatistics
  • +
  • checkTaskFunctions
  • +
  • checkWorkerOptions
  • +
  • emitDestroy
  • +
  • endTaskPerformance
  • +
  • getMainWorker
  • +
  • getTaskFunction
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctions
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionsListToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • startCheckActive
  • +
  • stopCheckActive
  • +
  • triggerAsyncId
  • +
  • updateLastTaskTimestamp
  • +
  • bind
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • EventLoopUtilizationMeasurementStatistics
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • IWorkerNode
  • +
  • MeasurementOptions
  • +
  • MeasurementStatistics
  • +
  • MeasurementStatisticsRequirements
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • StrategyPolicy
  • +
  • Task
  • +
  • TaskError
  • +
  • TaskPerformance
  • +
  • TaskStatistics
  • +
  • TaskStatisticsRequirements
  • +
  • TasksQueueOptions
  • +
  • ThreadPoolOptions
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerInfo
  • +
  • WorkerOptions
  • +
  • WorkerStatistics
  • +
  • WorkerUsage
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • KillHandler
  • +
  • Measurement
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskAsyncFunction
  • +
  • TaskFunction
  • +
  • TaskFunctions
  • +
  • TaskSyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • Measurements
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file