X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=e49051932e9161ea55991180b3d392b5c1b2baaf;hb=afc003b20097712625ffd053e256ef5336e27b6e;hp=fe962139bfb6f81fa119ac3053a8f35d98a8b2e8;hpb=6f0e7f0609e779dbf314d3f1a31660e7d369f591;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index fe962139..e4905193 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -6,7 +6,7 @@ poolifier +
  • The search index is not available
  • poolifier
    @@ -44,7 +44,7 @@ +
  • Defined in src/pools/cluster/fixed.ts:39
  • @@ -58,37 +58,32 @@

    Properties

    Accessors

    Methods

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

    emitter?: PoolEmitter
    -
    -

    Inherit Doc

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

    Id of the next message.

    +
    filePath: string
    +

    Path to the worker-file.

    +
  • Defined in src/pools/abstract-pool.ts:67
  • -
    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[] = []
    -
    -

    Inherit Doc

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

    Inherit Doc

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

    @@ -213,40 +198,51 @@
    -
    - -
    +
    + +
    +
    + +
    • get numberOfRunningTasks(): number
    • -
      -

      Inherit Doc

      +

      Number of tasks concurrently running in the pool.

      +

      Returns number

    +
  • Defined in src/pools/abstract-pool.ts:163
  • +
  • Defined in src/pools/cluster/fixed.ts:99
  • Methods

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

      @@ -255,24 +251,24 @@ 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:278
    • -
      -

      Inherit Doc

      +

      {@inheritDoc}

      +

      Parameters

    -
    - +
  • Defined in src/pools/cluster/fixed.ts:93
  • +
    +
      - +
    • Hook executed before the worker task promise resolution. Can be overridden.

      @@ -294,27 +290,27 @@ Can be overridden.

      Parameters

      • -
        worker: Worker
        -

        The worker.

        +
        workerKey: number
        +

        The worker key.

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:267
    • - +
    • Chooses a worker for the next task.

      -

      The default implementation uses a round robin algorithm to distribute the load.

      +

      The default uses a round robin algorithm to distribute the load.

      -

      Returns

      Worker.

      +

      Returns

      [worker key, worker].

      -

      Returns Worker

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

      Inherit Doc

      +

      {@inheritDoc}

      +

      Returns Worker

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

      Inherit Doc

      +

      {@inheritDoc}

      +

      Returns Promise<void>

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

      Inherit Doc

      +

      {@inheritDoc}

      +

      Parameters

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

      Inherit Doc

      +

      {@inheritDoc}

      +

      Parameters

    -
    - -
      - -
    • -
      -

      Inherit Doc

      -

      Returns false | Worker

    -
    - -
      - -
    • -
      -

      Inherit Doc

      -
      -

      Parameters

      -
        -
      • -
        worker: Worker
      -

      Returns undefined | number

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

      Inherit Doc

      -
      -

      Parameters

      -
        -
      • -
        worker: Worker
      +

      {@inheritDoc}

      +

      Returns number

    -
    - -
      - -
    • -
      -

      Inherit Doc

      -
      -

      Parameters

      -
        -
      • -
        worker: Worker
      -

      Returns undefined | number

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

      Parameters

      -
        -
      • -
        worker: Worker
      • -
      • -
        messageId: number
      -

      Returns Promise<Response>

    -
    - -
      - +
    • Returns boolean

    +
  • Defined in src/pools/abstract-pool.ts:202
  • +
  • Defined in src/pools/cluster/fixed.ts:64
    • -
      -

      Inherit Doc

      +

      {@inheritDoc}

      +

      Type Parameters

        @@ -510,7 +442,7 @@ Can be overridden.

        Returns void

      +
    • Defined in src/pools/cluster/fixed.ts:80
    +
  • Defined in src/pools/abstract-pool.ts:475
    • -
      -

      Inherit Doc

      +

      {@inheritDoc}

      +

      Parameters

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

      Inherit Doc

      +

      {@inheritDoc}

      +

      Parameters

      • -
        workerChoiceStrategy: "ROUND_ROBIN" | "LESS_RECENTLY_USED" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"
      +
      workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"

    Returns void

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