X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractWorker.html;h=0683a5af336cdebcc505b70b02630e15e2f13dfb;hb=8735b4e51c0cfabc9612d57417834d42042cab4e;hp=67fa900bf1fa2ea2cfc5ba63b43406e0c5424647;hpb=5decbf239157d04bdf38a642fe2757f565a8d466;p=poolifier.git diff --git a/docs/classes/AbstractWorker.html b/docs/classes/AbstractWorker.html index 67fa900b..0683a5af 100644 --- a/docs/classes/AbstractWorker.html +++ b/docs/classes/AbstractWorker.html @@ -1,4 +1,4 @@ -AbstractWorker | poolifier
+AbstractWorker | poolifier - v2.6.29
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.29
    @@ -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:49
  • @@ -51,42 +55,60 @@

    Constructors

    - +
      - +
    • Constructs a new poolifier worker.

      @@ -94,7 +116,7 @@

      Type Parameters

      • -

        MainWorker extends Worker | MessagePort

      • +

        MainWorker extends MessagePort | Worker

      • Data = unknown

      • @@ -105,92 +127,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 = ...
        +
        opts: WorkerOptions = DEFAULT_WORKER_OPTIONS

        Options for the worker.

        -
      -

      Returns AbstractWorker<MainWorker, Data, Response>

    +

    Returns AbstractWorker<MainWorker, Data, Response>

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

    -
    - -
    aliveInterval?: Timeout
    -

    Handler id of the aliveInterval worker alive check.

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

    -
    +
  • Defined in src/worker/abstract-worker.ts:88
  • +
    + +
    statistics: WorkerStatistics
    +

    Performance statistics computation requirements.

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

    +
    + +
    - +
      - +
    • -

      Returns number

      The unique asyncId assigned to the resource.

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

    Returns Func

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

    Returns void

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

    Returns void

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

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

    Returns string

    Message of the error.

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns Func

    +
  • Defined in node_modules/.pnpm/@types+node@20.5.1/node_modules/@types/node/async_hooks.d.ts:277
  • +
  • constructor
  • +
  • activeInterval
  • +
  • id
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • mainWorker
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • beginTaskPerformance
  • +
  • bind
  • +
  • checkActive
  • +
  • checkMessageWorkerId
  • +
  • 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