X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=f9dfcb3931ff6e9456eb709d474b12fb2b9b622d;hb=b2ec8632edaea1f4ee24a532e61ca6e5619b7bfb;hp=129160a1ea042c6bdbec37bdb05046a348e45c60;hpb=4f487526a63c873d168386250b40ad8103c5a4d8;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 129160a1..f9dfcb39 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,13 +1,13 @@ -FixedClusterPool | poolifier
+FixedClusterPool | poolifier - v3.0.5
-
+
  • The search index is not available
  • poolifier - v3.0.5 +
    @@ -17,8 +17,6 @@

    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

    @@ -30,12 +28,12 @@
    • 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.

    @@ -47,20 +45,21 @@
    +
  • Defined in src/pools/cluster/fixed.ts:33
  • - +

    Constructors

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

    - -
    emitter?: PoolEmitter
    -

    Emitter on which events can be listened to.

    + +
    emitter?: EventEmitterAsyncResource
    +

    Event emitter integrated with async resource on which events can be listened to. +The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

    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:75
  • filePath: string
    @@ -164,7 +183,16 @@
    +
  • Defined in src/pools/abstract-pool.ts:130
  • +
    + +
    max?: number
    +

    Dynamic pool maximum size property placeholder.

    +
    +
    numberOfWorkers: number
    @@ -173,7 +201,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:129
  • @@ -182,11 +210,11 @@
    +
  • 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:

    +
  • Defined in src/pools/abstract-pool.ts:89
  • 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:95
  • - -
    workerNodes: WorkerNode<Worker, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    @@ -230,7 +257,7 @@
    +
  • Defined in src/pools/cluster/fixed.ts:140
  • +
  • Defined in src/pools/abstract-pool.ts:660
  • -
    +
  • Defined in src/pools/abstract-pool.ts:273
  • +
    -
      +
      • get maxSize(): number
      • -

        Pool maximum size.

        +

        The pool maximum size.

        Returns number

    -
    +
  • Defined in src/pools/abstract-pool.ts:486
  • +
    -
      +
      • get minSize(): number
      • -

        Pool minimum size.

        +

        The pool minimum size.

        Returns number

    +
    + +
      +
    • get ready(): boolean
    • +
    • +

      The pool readiness boolean status.

      +
      +

      Returns boolean

      +
    +
  • Defined in src/pools/abstract-pool.ts:431
    • get type(): "fixed" | "dynamic"
    • -

      Pool type.

      +

      The pool type.

      If it is 'dynamic', it provides the max property.

      Returns "fixed" | "dynamic"

    +
  • Defined in src/pools/cluster/fixed.ts:130
  • +
    + +
      +
    • get utilization(): number
    • +
    • +

      The approximate pool utilization.

      +
      +

      Returns number

      The pool utilization.

      + +
      -
    • get worker(): "cluster" | "thread"
    • +
    • get worker(): "thread" | "cluster"
    • -

      Gets the worker type.

      +

      The worker type.

      -

      Returns "cluster" | "thread"

      +

      Returns "thread" | "cluster"

    +
  • Defined in src/pools/cluster/fixed.ts:135
  • Methods

    +
    + +
      - +
    • Hook executed after the worker task execution. Can be overridden.

      @@ -319,12 +402,12 @@ Can be overridden.

      Parameters

      • -
        worker: Worker
        -

        The worker.

        +
        workerNodeKey: number
        +

        The worker node key.

      • -
        message: MessageValue<Response, Worker | MessagePort>
        +
        message: MessageValue<Response, unknown>

        The received message.

      @@ -332,32 +415,32 @@ Can be overridden.

    -
    - -
    +
    + +
      +
    • -

      Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes.

      -

      Can be used to update the maxListeners or binding the main-worker<->worker connection if not bind by default.

      +

      Method hooked up after a worker node has been newly created. +Can be overridden.

      Parameters

      • -
        worker: Worker
        -

        The newly created worker.

        +
        workerNodeKey: number
        +

        The newly created worker node key.

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:1356
    • - +
    • Hook executed before the worker task execution. Can be overridden.

      @@ -369,112 +452,158 @@ Can be overridden.

      workerNodeKey: number

      The worker node key.

      +
    • +
    • +
      task: Task<Data>
      +

      The task to execute.

      +

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:1013
  • +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1260
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1216
  • +
  • Defined in src/pools/cluster/fixed.ts:125
  • +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:949
  • +
    +
    +
  • Defined in src/pools/cluster/fixed.ts:63
  • +
  • Defined in src/pools/abstract-pool.ts:564
  • Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    @@ -496,16 +630,111 @@ Can be overridden.

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

    Returns void

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:101
  • +
    + +
    +
    + +
    +
    + +
    +
  • Defined in src/pools/cluster/fixed.ts:83
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:578
  • +
  • Defined in src/pools/abstract-pool.ts:531
  • +
  • Defined in src/pools/abstract-pool.ts:550
  • -
    - -
    +
    + +
    +
    + + +
    message: MessageValue<Response, unknown>
    +

    Returns void

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

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file