X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FClusterWorker.html;h=8e355dd5cc732c4e3f3f551e4298b7984b3d947f;hb=31542ddfe8297d3bd0f9cf97a3de06a03dafc15d;hp=95f1772e8cf266f76a36e13cf4204e73e0cf139c;hpb=8d1797ad15cb2d87ac3c9904ce6df3db45c0c742;p=poolifier.git diff --git a/docs/classes/ClusterWorker.html b/docs/classes/ClusterWorker.html index 95f1772e..e088cd1b 100644 --- a/docs/classes/ClusterWorker.html +++ b/docs/classes/ClusterWorker.html @@ -1,4 +1,4 @@ -ClusterWorker | poolifier
+ClusterWorker | poolifier - v2.6.32
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.32
    @@ -21,22 +21,25 @@ it will send a termination request to its main worker.

    If you use a DynamicClusterPool the extra workers that were created will be terminated, but the minimum number of workers will be guaranteed.

    +
    +
    +

    Author

    Christopher Quadflieg

    -

    Author

    Christopher Quadflieg

    - -

    Since

    2.0.0

    +

    Since

    2.0.0

    -
    +

    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

      @@ -44,7 +47,7 @@ but the minimum number of workers will be guaranteed.

      • ClusterWorker
    +
  • Defined in src/worker/cluster-worker.ts:21
  • @@ -52,44 +55,57 @@ but the minimum number of workers will be guaranteed.

    Constructors

    - +
      - +
    • Constructs a new poolifier cluster worker.

      -
      +

      Type Parameters

      -
        +
        • Data = unknown

        • @@ -98,87 +114,146 @@ but the minimum number of workers will be guaranteed.

          Parameters

          • -
            fn: WorkerFunction<Data, Response>
            -

            Function processed by the worker when the pool's execution function is invoked.

            -
          • +
            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 ClusterWorker<Data, Response>

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

    Reference to main worker.

    -
    +
  • Defined in src/worker/abstract-worker.ts:65
  • - -
    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, TaskFunction<Data, Response>>
    +

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

    +
    +
    +
    +

    Accessors

    +
    + +

    Methods

    +
    + +
    - +
      - +
    • -
      -

      Returns

      The unique asyncId assigned to the resource.

      -
      -

      Returns number

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

    Returns Func & {
        asyncResource: AsyncResource;
    }

    -
    - - +

    Returns Func

    +
    +

    Since

    v14.8.0, v12.19.0

    +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.3/node_modules/@types/node/async_hooks.d.ts:283
  • - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.3/node_modules/@types/node/async_hooks.d.ts:302
  • - +
    -
    - -
    +
    + + -

    Returns string

    +
    + +
    +
    + +
    +
  • Defined in src/worker/cluster-worker.ts:45
  • +
    + +
    +
    + +
    - + +

    Returns void

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

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

    Returns void

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

    Returns void

    +
  • Defined in src/worker/cluster-worker.ts:70
  • +
    + +
    - +
    +
  • Defined in node_modules/.pnpm/@types+node@20.5.3/node_modules/@types/node/async_hooks.d.ts:311
  • - +
    +
  • constructor
  • +
  • activeInterval
  • +
  • isMain
  • +
  • lastTaskTimestamp
  • +
  • opts
  • +
  • statistics
  • +
  • taskFunctions
  • +
  • id
  • +
  • addTaskFunction
  • +
  • asyncId
  • +
  • bind
  • +
  • emitDestroy
  • +
  • getMainWorker
  • +
  • handleError
  • +
  • handleKillMessage
  • +
  • handleReadyMessage
  • +
  • hasTaskFunction
  • +
  • listTaskFunctions
  • +
  • messageListener
  • +
  • removeTaskFunction
  • +
  • run
  • +
  • runAsync
  • +
  • runInAsyncScope
  • +
  • runSync
  • +
  • sendTaskFunctionsListToMainWorker
  • +
  • sendToMainWorker
  • +
  • setDefaultTaskFunction
  • +
  • triggerAsyncId
  • +
  • bind
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • Deque
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • 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