X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=1252ca037b9beef4abf792bd812f6909eb0b6c9c;hb=2a6631992868d900762f62e4c228dce4e4ee549a;hp=8d6c7ffc8e4fbc93ab63db68f64f06889d250586;hpb=86f5c6c11d0a262b6514b95928b2534eecc37a4e;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 8d6c7ffc..1252ca03 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -19,22 +19,25 @@

A cluster pool with a dynamic number of workers, but a guaranteed minimum number of workers.

This cluster pool creates new workers when the others are busy, up to the maximum number of workers. When the maximum number of workers is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

+
+
+

Author

Christopher Quadflieg

-

Author

Christopher Quadflieg

- -

Since

2.0.0

+

Since

2.0.0

Type Parameters

+

Type of execution response. This can only be structured-cloneable data.

+
+

Hierarchy

+
  • Defined in src/pools/cluster/dynamic.ts:15
  • @@ -50,55 +53,58 @@ When the maximum number of workers is reached and workers are busy, an event is

    Constructors

    - + -

    Returns DynamicClusterPool<Data, Response>

    +
  • Defined in src/pools/cluster/dynamic.ts:27
  • Properties

    - +
    emitter?: PoolEmitter

    Emitter on which events can be listened to.

    Events that can currently be listened to:

    • 'full': Emitted when the pool is dynamic and full.
    • 'busy': Emitted when the pool is busy.
    • +
    • 'error': Emitted when an uncaught error occurs.
    • +
    • 'taskError': Emitted when an error occurs while executing a task.
    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:58
  • +
    +
    filePath: string

    Path to the worker file.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:96
  • +
    +
    max: number

    Maximum number of workers that can be created by this pool.

    -
    -
    - +
  • Defined in src/pools/cluster/dynamic.ts:29
  • +
    +
    numberOfWorkers: number

    Number of workers that this pool should manage.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:95
  • +
    +

    Options for this fixed cluster pool.

    -
    +
  • Defined in src/pools/cluster/fixed.ts:52
  • - +
    promiseResponseMap: Map<string, PromiseResponseWrapper<Worker, Response>> = ...

    The execution response promise map.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    +
  • Defined in src/pools/abstract-pool.ts:68
  • - +
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>

    Worker choice strategy context referencing a worker choice algorithm implementation.

    -

    Default to a round robin algorithm.

    -
    +
  • Defined in src/pools/abstract-pool.ts:76
  • - +
    workerNodes: WorkerNode<Worker, Data>[] = []

    Pool worker nodes.

    -
    +
  • Defined in src/pools/abstract-pool.ts:55
  • Accessors

    - +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:250
  • +
    + +
    +
    + +
    +
    +
    -
    - -
    +
    + +
    +
  • Defined in src/pools/cluster/dynamic.ts:37
  • +
    + +
    +
    + +

    Methods

    - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:555
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:747
  • - + -

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:539
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:790
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:757
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:82
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:500
  • - + -

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:68
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:406
  • - +

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    -
    +
  • Defined in src/pools/abstract-pool.ts:466
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:457
  • - +
    -
    - -
    +
  • Defined in src/pools/cluster/fixed.ts:63
  • - + -

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:77
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:418
  • - + +

    Returns void

    +
    +
  • Defined in src/pools/abstract-pool.ts:373
  • - + -

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:395
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:58
  • - +

    Returns void

    The listener function to execute when a message is received from a worker.

    -
    +
  • Defined in src/pools/abstract-pool.ts:815
  • +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • runTime
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • createAndSetupDynamicWorker
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • internalBusy
  • +
  • isMain
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • EventLoopUtilizationMeasurementStatistics
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • MeasurementOptions
  • +
  • MeasurementStatistics
  • +
  • MeasurementStatisticsRequirements
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • StrategyPolicy
  • +
  • Task
  • +
  • TaskError
  • +
  • TaskPerformance
  • +
  • TaskStatistics
  • +
  • TaskStatisticsRequirements
  • +
  • TasksQueueOptions
  • +
  • ThreadPoolOptions
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerInfo
  • +
  • WorkerNode
  • +
  • WorkerOptions
  • +
  • WorkerStatistics
  • +
  • WorkerUsage
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • Measurement
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskFunctions
  • +
  • WorkerAsyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerFunction
  • +
  • WorkerSyncFunction
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • Measurements
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file