X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=adb3ab28e4f45c1b2df59f518299961e7f1b5319;hb=94ab998f44abe7ed2184a0702c45621b06f5641f;hp=c32a3c747c89baab5c9a71e97db9b82418cb2c1f;hpb=b08b5fc507f21848c9435380edb7d155e92eaaf5;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index c32a3c74..adb3ab28 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -6,7 +6,7 @@ poolifier +
  • The search index is not available
  • poolifier
    @@ -18,7 +18,7 @@

    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.

    +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

    @@ -42,7 +42,7 @@ When the maximum number of workers is reached, an event is emitted. If you want
    • DynamicClusterPool
    +
  • Defined in src/pools/cluster/dynamic.ts:16
  • @@ -56,38 +56,33 @@ When the maximum number of workers is reached, an event is emitted. If you want

    Properties

    Accessors

    Methods

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

    @@ -144,76 +139,68 @@ When the maximum number of workers is reached, an event is emitted. If you want

    Inherit Doc

    +
  • Defined in src/pools/abstract-pool.ts:32
  • -
    filePath: string
    -
    - -
    max: number
    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

    +
  • Defined in src/pools/abstract-pool.ts:67
  • +
    + +
    max: number
    +

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

    +
  • Defined in src/pools/cluster/dynamic.ts:30
  • -
    numberOfWorkers: number
    +
  • Defined in src/pools/abstract-pool.ts:66
  • -
    -
    - -
    promiseMap: Map<number, PromiseWorkerResponseWrapper<Worker, Response>> = ...
    -

    The promise map.

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

    The promise response map.

      -
    • key: This is the message Id of each submitted task.
    • -
    • value: An object that contains the worker, the resolve function and the reject function.
    • +
    • key: The message id of each submitted task.
    • +
    • value: An object that contains the worker, the promise resolve and reject callbacks.
    -

    When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.

    +

    When we receive a message from the worker we get a map entry with the promise resolve/reject bound to the message.

    +
  • Defined in src/pools/abstract-pool.ts:42
  • workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
    -

    Worker choice strategy instance implementing the worker choice algorithm.

    -

    Default to a strategy implementing a round robin algorithm.

    +

    Worker choice strategy context referencing a worker choice algorithm implementation.

    +

    Default to a round robin algorithm.

    +
  • Defined in src/pools/abstract-pool.ts:52
  • -
    workers: Worker[] = []
    +
    workers: WorkerType<Worker>[] = []

    Inherit Doc

    -
    - -
    workersTasksUsage: Map<Worker, TasksUsage> = ...
    -
    -

    Inherit Doc

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

    @@ -226,18 +213,29 @@ When the maximum number of workers is reached, an event is emitted. If you want

    Returns boolean

    -
    - -
    +
    + +
    +
    + +
      +
    • get numberOfRunningTasks(): number
    • +
    • +

      Number of tasks concurrently running in the pool.

      +

      Returns number

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

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

      @@ -263,17 +261,17 @@ Can be overridden.

      Parameters

      • -
        message: MessageValue<Response, unknown>
        -

        The received message.

        +
        worker: Worker
        +

        The worker.

      • -
        promise: PromiseWorkerResponseWrapper<Worker, Response>
        -

        The Promise response.

        +
        message: MessageValue<Response, unknown>
        +

        The received message.

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:268
  • -
    - +
  • Defined in src/pools/cluster/fixed.ts:93
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:257
  • +
  • Defined in src/pools/abstract-pool.ts:297
  • +
  • Defined in src/pools/abstract-pool.ts:363
  • +
  • Defined in src/pools/cluster/fixed.ts:88
  • +
  • Defined in src/pools/abstract-pool.ts:220
  • +
  • Defined in src/pools/cluster/fixed.ts:69
  • -
    - -
    -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:204
  • +
    +
    -
    - -
    -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:197
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:189
  • +
  • Defined in src/pools/cluster/fixed.ts:64
  • +
  • Defined in src/pools/cluster/fixed.ts:80
  • +
  • Defined in src/pools/abstract-pool.ts:487
  • +
  • Defined in src/pools/cluster/fixed.ts:75
  • +
    workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:164
  • +
  • Defined in src/pools/cluster/fixed.ts:59
  • +
  • Defined in src/pools/abstract-pool.ts:392