X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractPool.html;h=d633e72ee14b0a655fbb17da2e69b2ba94ddd6cf;hb=c22b117f8593bba575a4385b8f125f14b4bf1099;hp=bf67558965e87ec5bc4d2f7b7682f78b2cde7b5f;hpb=15d6dfaf877ec6a99e2bde48cb3c8a9e8671c075;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index bf675589..d633e72e 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,4 +1,4 @@ -AbstractPool | poolifier
+AbstractPool | poolifier - v2.6.29
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.29
    @@ -29,12 +29,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.

  • @@ -49,7 +49,7 @@
    • IPool<Worker, Data, Response>
    +
  • Defined in src/pools/abstract-pool.ts:56
  • @@ -66,6 +66,8 @@ numberOfWorkers opts promiseResponseMap +startTimestamp +starting workerChoiceStrategyContext workerNodes
    @@ -76,50 +78,69 @@ info maxSize minSize +ready type +utilization worker

    Methods

    -
    @@ -135,7 +156,7 @@

    Type Parameters

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

    @@ -170,16 +191,19 @@

    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 at least one task.
    • +
    • '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 >= pool maximum size^2).
    +
  • Defined in src/pools/abstract-pool.ts:65
  • filePath: string
    @@ -187,7 +211,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:105
  • numberOfWorkers: number
    @@ -195,7 +219,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:104
  • opts: PoolOptions<Worker>
    @@ -203,11 +227,11 @@
    +
  • Defined in src/pools/abstract-pool.ts:106
  • -
    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.
    • @@ -216,25 +240,40 @@
    +
  • Defined in src/pools/abstract-pool.ts:75
  • +
    + +
    startTimestamp: number
    +

    The start timestamp of the pool.

    +
    +
    +
    + +
    starting: boolean
    +

    Whether the pool is starting or not.

    +
    +
    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:81
  • - -
    workerNodes: WorkerNode<Worker, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    @@ -248,7 +287,7 @@

    Returns boolean

    +
  • Defined in src/pools/abstract-pool.ts:640
  • +
  • Defined in src/pools/abstract-pool.ts:631
  • +
  • Defined in src/pools/abstract-pool.ts:321
  • +
  • Defined in src/pools/abstract-pool.ts:517
  • +
  • Defined in src/pools/abstract-pool.ts:512
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:502
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:507
  • Methods

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

      @@ -332,43 +416,43 @@ 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.

      Returns void

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

      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:1081
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:795
  • Returns TasksQueueOptions

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

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:158
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:202
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:284
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:230
  • Returns void

    -
    - -
    +
    + +
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1028
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:988
  • +
  • Defined in src/pools/abstract-pool.ts:981
  • Returns undefined | Task<Data>

    +
  • Defined in src/pools/abstract-pool.ts:1319
  • -
    - +
  • Defined in src/pools/abstract-pool.ts:741
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:771
  • +
  • Defined in src/pools/abstract-pool.ts:596
  • Returns number

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

    Returns void

    +
    -
    - -
    +
    + +

    Returns void

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

    Returns number

    The worker node key if the worker is found in the pool worker nodes, -1 otherwise.

    +

    Returns number

    The worker node key if found in the pool worker nodes, -1 otherwise.

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:1115
  • Returns void

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:1068
  • +
  • Defined in src/pools/abstract-pool.ts:1275
  • +
    + +
    +
    + +
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:970
  • +
  • Defined in src/pools/abstract-pool.ts:608
  • +
  • Defined in src/pools/abstract-pool.ts:563
  • -
    - -
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:779
  • +
    + +
    +
    +
    -
    - -
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:308
  • Returns number

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

    Returns void

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

    Returns void

    +
    + +
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:889
  • +
  • Defined in src/pools/abstract-pool.ts:1164
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file