X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=2c08b7ebb719b05ee671cb3e58b23748cf6137a1;hb=76369162548ededf89e0d513174a943cc330245c;hp=77cdcd29be25504d72f3344b91605c6c7ea39394;hpb=1938bc376fa92d0c773c4c23b0305291ab483e6c;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 77cdcd29..2c08b7eb 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,15 +1,15 @@ -DynamicClusterPool | poolifier
+DynamicClusterPool | poolifier - v3.0.4
-
+
  • The search index is not available
  • poolifier - v3.0.4 +
    -
    +
    • poolifier
    • @@ -18,524 +18,1048 @@

      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, an event is emitted. If you want to listen to this event, use the pool's emitter.

      - -

      Author

      Christopher Quadflieg

      +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

      -

      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.

          -
        • +

          Data = unknown

          +

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

          +
          +
        • -

          Response = unknown

          -

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

          -
      +

      Response = unknown

      +

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

      +
      +

    Hierarchy

    +
  • Defined in src/pools/cluster/dynamic.ts:16
  • - +

    Constructors

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

        -
        +

        Type Parameters

        -
          +
          • -

            Data = unknown

          • +

            Data = unknown

          • -

            Response = unknown

        +

        Response = unknown

      Parameters

      • -
        min: number
        +
        min: number

        Minimum number of workers which are always active.

        -
      • +
      +
    • -
      max: number
      +
      max: number

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

      -
    • +
    +
  • -
    filePath: string
    +
    filePath: string

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

    -
  • +
    +
  • -
    opts: ClusterPoolOptions = {}
    +
    opts: ClusterPoolOptions = {}

    Options for this dynamic cluster pool.

    -
  • -

    Returns DynamicClusterPool<Data, Response>

    +
    +

    Returns DynamicClusterPool<Data, Response>

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

    -
    - -
    emitter?: PoolEmitter
    -

    {@inheritDoc}

    -
    +
    + +
    max: number

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

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

    Number of workers that this pool should manage.

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

    Options for this fixed cluster pool.

    -
    -
    - -
    promiseResponseMap: Map<string, PromiseResponseWrapper<Worker, Response>> = ...
    -

    The promise response map.

    +
  • Defined in src/pools/cluster/fixed.ts:47
  • +
    + +
    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 promise resolve and reject callbacks.
    • +
    • 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.

    -
    -
    - -
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
    -

    Worker choice strategy instance implementing the worker choice algorithm.

    -

    Default to a strategy implementing a round robin algorithm.

    -
    +
    + +
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
    +

    Worker choice strategy context referencing a worker choice algorithm implementation.

    +
    +
    -
    - -
    workers: WorkerType<Worker>[] = []
    -

    {@inheritDoc}

    -
    +
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []
    +

    Pool worker nodes.

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

    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
  • Defined in src/pools/cluster/dynamic.ts:39
  • +
    + +
    +
    + +

    Methods

    -
    - -
    -
    - -
    +
    + + +

    Returns void

    +
    -
    - -
    +
    + + +

    Returns void

    +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    -
    - -
    +
    + + +

    Returns Promise<void>

    +
    -
    - -
    +
    + + +

    Returns void

    +
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +

    Parameters

    Returns void

    -

    Returns void

    +
    + +
    -
    - -
    +
    + + +

    Returns Promise<boolean>

    true if the task function was removed, false otherwise.

    + +
    -
    - -
    +
    + +
    +
    + +
    +
    + + +

    Returns void

    +
    -
    - -
    +
    + + +

    Returns Promise<boolean>

    true if the default task function was set, false otherwise.

    + +
    +
    + +
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    - +
    +
    +
    +

    On This Page

    - -
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • ready
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • addTaskFunction
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerNodeSetup
  • +
  • beforeTaskExecutionHook
  • +
  • createAndSetupDynamicWorkerNode
  • +
  • createAndSetupWorkerNode
  • +
  • createWorker
  • +
  • deregisterWorkerMessageListener
  • +
  • destroy
  • +
  • destroyWorkerNode
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • flagWorkerNodeAsNotReady
  • +
  • flushTasksQueue
  • +
  • getWorkerInfo
  • +
  • hasTaskFunction
  • +
  • hasWorkerNodeBackPressure
  • +
  • internalBusy
  • +
  • isMain
  • +
  • listTaskFunctionNames
  • +
  • registerOnceWorkerMessageListener
  • +
  • registerWorkerMessageListener
  • +
  • removeTaskFunction
  • +
  • sendKillMessageToWorker
  • +
  • sendStartupMessageToWorker
  • +
  • sendToWorker
  • +
  • setDefaultTaskFunction
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • start
  • +
  • workerMessageListener
  • + +
    +

    Generated using TypeDoc

    +
    \ No newline at end of file