X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=2955f106307ee1d2a91a2a866401ba734088a841;hb=761b0c73be0bf581f50a78123913f933bd405f52;hp=c01b7c9ed62d788ed7cc1b0d578e249e68479ff5;hpb=8bd0b5363ad2defbce7c1cc49e616c24ad135dde;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index c01b7c9e..2955f106 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,4 +1,4 @@ -FixedClusterPool | poolifier
+FixedClusterPool | poolifier
-
+ @@ -101,7 +100,7 @@
-

Returns FixedClusterPool<Data, Response>

Properties

emitter?: PoolEmitter
-

{@inheritDoc}

+

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

    Path to the worker-file.

    -
    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

    +

    Path to the worker file.

    +
  • Defined in src/pools/abstract-pool.ts:77
  • numberOfWorkers: number

    Number of workers that this pool should manage.

    +
  • Defined in src/pools/abstract-pool.ts:76
  • Options for this fixed cluster pool.

    -
    - -
    promiseMap: Map<number, PromiseWorkerResponseWrapper<Worker, Response>> = ...
    -

    The promise map.

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

    The execution response promise 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 execution response 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 id.

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

    Worker choice strategy instance implementing the worker choice algorithm.

    -

    Default to a strategy implementing a round robin algorithm.

    -
    -
    - -
    workers: Worker[] = []
    -

    {@inheritDoc}

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

    Worker choice strategy context referencing a worker choice algorithm implementation.

    +

    Default to a round robin algorithm.

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

    {@inheritDoc}

    +
  • Defined in src/pools/abstract-pool.ts:62
  • +
    + +
    workerNodes: WorkerNode<Worker, Data>[] = []
    +

    Pool worker nodes.

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

    -
    - -
    +
    + +
      +
    • get full(): boolean
    • +
    • +

      Whether the pool is full or not.

      +

      The pool filling boolean status.

      +
      +

      Returns boolean

    +
    + +
      +
    • get numberOfQueuedTasks(): number
    • +
    • +

      Number of tasks queued in the pool.

      +
      +

      Returns number

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

      {@inheritDoc}

      +

      Number of tasks running in the pool.

      Returns number

    +
  • Defined in src/pools/abstract-pool.ts:185
    • -
    • get type(): PoolType
    • +
    • get type(): PoolType
    • -

      {@inheritDoc}

      +

      Pool type.

      +

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

      -

      Returns PoolType

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

    -
    - +
    +
      - +
    • -

      Hook executed after the worker task promise resolution. +

      Hook executed after the worker task execution. 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:389
    • -

      {@inheritDoc}

      +

      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.

      Parameters

      • -
        worker: Worker
      +
      worker: Worker
      +

      The newly created worker.

      +

    Returns void

    -
    - +
  • Defined in src/pools/cluster/fixed.ts:93
  • +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:378
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:422
  • +
  • Defined in src/pools/abstract-pool.ts:484
  • +
  • Defined in src/pools/cluster/fixed.ts:88
  • -
    - -
    +
    + +

    Returns void

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

    Returns void

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

    Returns Promise<Response>

    -
    - +
  • Defined in src/pools/abstract-pool.ts:310
  • +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:303
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:298
  • -
    - -
    +
    + +

    Returns void

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

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:244
  • +
  • Defined in src/pools/cluster/fixed.ts:59
  • - +
    +
    -
    +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • numberOfQueuedTasks
  • +
  • numberOfRunningTasks
  • +
  • type
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • chooseWorkerNode
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • findFreeWorkerNodeKey
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • + +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file