X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=98f5c30d4c20f78c2b940cc01118016592505737;hb=447eca603b96bc46303dfa16f3048b68ae576b0c;hp=cda595b96829af9956ada0e732844666d8f47a25;hpb=dea288f11483ea6c15807b20e4c621483c7fa5af;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index cda595b9..98f5c30d 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,13 +1,13 @@ -FixedClusterPool | poolifier
+FixedClusterPool | poolifier - v2.7.0
-
+
  • The search index is not available
  • poolifier - v2.7.0 +
    @@ -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.

      @@ -117,165 +134,263 @@
    • 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:69
  • +
    +
    filePath: string

    Path to the worker file.

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

    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:66
  • Accessors

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

    Methods

    +
    + +
    - + +

    Returns void

    +
    -
    - -
    +
    + + +

    Returns void

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

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:1060
  • +
    + +
    +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1307
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1263
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:108
  • - +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1000
  • +
    + +

    Returns Promise<void>

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

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

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

    Returns void

    -

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

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

    On This Page

    +

    On This Page

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

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file