X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=d700789a89265f8f89cf20239b5a3f2f56c900bf;hb=41ad8560b4bc9bed1f1840deda65d619ba68d485;hp=18268c8c12f8b700b51b2d33c01ebe0d4473b7e6;hpb=938d9c678aa8e70e5642feffb90604cf25c993fe;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 18268c8c..17fa4ab1 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,13 +1,13 @@ -FixedClusterPool | poolifier
+FixedClusterPool | poolifier - v2.6.41
-
+
  • The search index is not available
  • poolifier - v2.6.41 +
    @@ -17,24 +17,25 @@

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    -

    It is possible to perform tasks in sync or asynchronous mode as you prefer.

    -

    This pool selects the workers in a round robin fashion.

    - -

    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

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

    Constructors

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

      -
      +

      Type Parameters

      -
        +
        • Data = unknown

        • @@ -116,154 +129,232 @@
        • numberOfWorkers: number

          Number of workers for this pool.

          -
        • +
    +
  • filePath: string

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

    -
  • +
    +
  • opts: ClusterPoolOptions = {}

    Options for this fixed cluster pool.

    -
  • -

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

    Dynamic pool maximum size property placeholder.

    +
    +
    +
    +
    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/fixed.ts:114
  • +
    + +
    +
    + +

    Methods

    - + +

    Returns void

    +
    -
    - -
    +
    + + +

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