X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=10e968f8a809e4966a607183ffab07d4170bbe17;hb=665702eef3ad8153279b344e0276687f7f50c10f;hp=0873748eb520a76b344e60b394dd693c84fd6036;hpb=3a592a1254b999797590d1b54662b747eed17528;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 0873748e..10e968f8 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,13 +1,13 @@ -DynamicClusterPool | poolifier
+DynamicClusterPool | poolifier - v2.6.42
-
+
  • The search index is not available
  • poolifier - v2.6.42 +
    @@ -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

    • Data = unknown

      -

      Type of data sent to the worker. This can only be serializable data.

      -
    • +

      Type of data sent to the worker. This can only be structured-cloneable data.

      +
      +
    • Response = unknown

      -

      Type of execution response. This can only be serializable data.

      -
    +

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

    +
    +

    Hierarchy

      @@ -42,63 +45,74 @@ When the maximum number of workers is reached and workers are busy, an event is
      • DynamicClusterPool
    +
  • Defined in src/pools/cluster/dynamic.ts:15
  • - +

    Constructors

    - +
      - +
    • Constructs a new poolifier dynamic cluster pool.

      @@ -115,165 +129,237 @@ When the maximum number of workers is reached and workers are busy, an event is
    • min: number

      Minimum number of workers which are always active.

      -
    • +
    +
  • max: number

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

    -
  • +
    +
  • filePath: string

    Path to an implementation of a ClusterWorker file, which can be relative or absolute.

    -
  • +
    +
  • opts: ClusterPoolOptions = {}

    Options for this dynamic cluster pool.

    -
  • -

    Returns DynamicClusterPool<Data, Response>

    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.
    • +
    • 'ready': Emitted when the number of workers created in the pool has reached the minimum size expected and are ready.
    • +
    • 'busy': Emitted when the number of workers created in the pool has reached the maximum size expected and are executing concurrently their tasks quota.
    • +
    • 'full': Emitted when the pool is dynamic and the number of workers created has reached the maximum size expected.
    • +
    • 'destroy': Emitted when the pool is destroyed.
    • +
    • 'error': Emitted when an uncaught error occurs.
    • +
    • 'taskError': Emitted when an error occurs while executing a task.
    • +
    • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:68
  • +
    +
    filePath: string

    Path to the worker file.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:117
  • +
    +
    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:116
  • +
    +

    Options for this fixed cluster pool.

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

    The execution response promise map.

    + +
    promiseResponseMap: Map<string, PromiseResponseWrapper<Response>> = ...
    +

    The task execution response promise map.

    • key: The message id of each submitted task.
    • value: An object that contains the worker, the execution response promise resolve and reject callbacks.

    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:78
  • - +
    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:84
  • - -
    workerNodes: WorkerNode<Worker, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    - +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:350
  • +
    + +
    +
    + +
    +
    +
    -
    - -
    +
    + +
    +
  • Defined in src/pools/cluster/dynamic.ts:38
  • +
    + +
    +
    + +

    Methods

    - + +

    Returns void

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

    Returns void

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

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:858
  • +
    +
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1105
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1061
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:109
  • - +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:803
  • +
    + +

    Returns Promise<void>

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

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:629
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:53
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:1321
  • -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • ready
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerNodeSetup
  • +
  • beforeTaskExecutionHook
  • +
  • checkDynamicPoolSize
  • +
  • createAndSetupDynamicWorkerNode
  • +
  • createAndSetupWorkerNode
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorkerNode
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • flushTasksQueue
  • +
  • getWorkerInfo
  • +
  • hasWorkerNodeBackPressure
  • +
  • internalBusy
  • +
  • isMain
  • +
  • listTaskFunctions
  • +
  • registerWorkerMessageListener
  • +
  • sendKillMessageToWorker
  • +
  • sendStartupMessageToWorker
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file