X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=20c167994831f58546e1c8f97e655fdec21469ff;hb=87f3b54969e17a64a69f3dc7ce4805493274a4f8;hp=3cedf527b9841924554d7817853abd1fac713386;hpb=8ad621cc1d32ed396fca3ef2ec48337e42d2dcc2;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 3cedf527..20c16799 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,13 +1,13 @@ -DynamicThreadPool | poolifier - v2.6.25
+DynamicThreadPool | poolifier - v3.0.2
-
+
  • The search index is not available
  • poolifier - v3.0.2 +
    @@ -45,21 +45,21 @@ When the maximum number of threads is reached and workers are busy, an event is
    • DynamicThreadPool
    +
  • Defined in src/pools/thread/dynamic.ts:16
  • - +

    Constructors

    - +
    +
  • Defined in src/pools/thread/dynamic.ts:28
  • 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 the number of workers created has reached the maximum size expected.
    • '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.
    • +
    • '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:74
  • filePath: string
    @@ -175,15 +188,16 @@ When the maximum number of threads is reached and workers are busy, an event is
    -
    +
  • Defined in src/pools/abstract-pool.ts:129
  • +
    max: number

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

    +
  • Defined in src/pools/thread/dynamic.ts:30
  • numberOfWorkers: number
    @@ -192,7 +206,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:128
  • @@ -201,11 +215,11 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/thread/fixed.ts:49
  • promiseResponseMap: Map<string, PromiseResponseWrapper<Response>> = ...
    -

    The task execution response promise map.

    +

    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.
    • @@ -215,7 +229,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:88
  • workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
    @@ -224,16 +238,16 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:94
  • - +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    @@ -248,7 +262,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/thread/dynamic.ts:44
    • @@ -261,7 +275,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:662
    • @@ -273,19 +287,19 @@ When the maximum number of threads is reached and workers are busy, an event is
    -
    +
  • Defined in src/pools/abstract-pool.ts:272
  • +
    -
      +
      • get maxSize(): number
      • The pool maximum size.

        Returns number

    +
  • Defined in src/pools/abstract-pool.ts:485
    • @@ -297,7 +311,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:478
    • @@ -309,7 +323,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:430
    • @@ -322,7 +336,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/thread/dynamic.ts:39
    • @@ -335,7 +349,7 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/abstract-pool.ts:447
    • @@ -347,9 +361,40 @@ When the maximum number of threads is reached and workers are busy, an event is
    +
  • Defined in src/pools/thread/fixed.ts:150
  • Methods

    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:1044
  • +
  • Defined in src/pools/abstract-pool.ts:1357
  • -
    - -
    +
  • Defined in src/pools/abstract-pool.ts:1014
  • +
  • Defined in src/pools/abstract-pool.ts:1261
  • +
  • Defined in src/pools/abstract-pool.ts:1217
  • +
  • Defined in src/pools/thread/fixed.ts:137
  • +
    + +
      + +
    • +

      Deregisters a listener callback on the worker given its worker node key.

      +
      +
      +

      Type Parameters

      +
        +
      • +

        Message

      +
      +

      Parameters

      +
        +
      • +
        workerNodeKey: number
        +

        The worker node key.

        +
        +
      • +
      • +
        listener: ((message) => void)
        +

        The message listener callback.

        +
        +
        +
          +
        • +
            +
          • (message): void
          • +
          • +
            +

            Parameters

            +
            +

            Returns void

      +

      Returns void

      +
    +
  • Defined in src/pools/abstract-pool.ts:951
  • +
  • Defined in src/pools/thread/fixed.ts:60
    • -

      Enables/disables the worker tasks queue in this pool.

      +

      Enables/disables the worker node tasks queue in this pool.

      Parameters

      • enable: boolean
        -

        Whether to enable or disable the worker tasks queue.

        +

        Whether to enable or disable the worker node tasks queue.

      • Optional tasksQueueOptions: TasksQueueOptions
        -

        The worker tasks queue options.

        +

        The worker node tasks queue options.

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:566
  • +
  • Defined in src/pools/abstract-pool.ts:881
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:1693
  • +
  • Defined in src/pools/abstract-pool.ts:1605
  • +
    + +
      + +
    • +

      Whether the specified task function exists in this pool.

      +
      +
      +

      Parameters

      +
        +
      • +
        name: string
        +

        The name of the task function.

        +
        +
      +

      Returns boolean

      true if the task function exists, false otherwise.

      + +
    +
    + +
      + +
    • Internal +

      Whether the worker node has back pressure (i.e. its tasks queue is full).

      +
      +
      +

      Parameters

      +
        +
      • +
        workerNodeKey: number
        +

        The worker node key.

        +
        +
      +

      Returns boolean

      true if the worker node has back pressure, false otherwise.

      + +
    +
  • Defined in src/pools/abstract-pool.ts:678
  • +
  • Defined in src/pools/thread/fixed.ts:55
  • +
    + +
    +
    + +
      + +
    • +

      Registers once a listener callback on the worker given its worker node key.

      +
      +
      +

      Type Parameters

      +
        +
      • +

        Message

      +
      +

      Parameters

      +
        +
      • +
        workerNodeKey: number
        +

        The worker node key.

        +
        +
      • +
      • +
        listener: ((message) => void)
        +

        The message listener callback.

        +
        +
        +
          +
        • +
            +
          • (message): void
          • +
          • +
            +

            Parameters

            +
            +

            Returns void

      +

      Returns void

      +
    +
  • Defined in src/pools/thread/fixed.ts:107
  • +
    + +
      + +
    • +

      Removes a task function from this pool.

      +
      +
      +

      Parameters

      +
        +
      • +
        name: string
        +

        The name of the task function.

        +
        +
      +

      Returns Promise<boolean>

      true if the task function was removed, false otherwise.

      + +
    +
    + +
    +
  • Defined in src/pools/thread/fixed.ts:92
  • +
  • Defined in src/pools/thread/fixed.ts:78
  • +
    + +
      + +
    • +

      Sets the default task function in this pool.

      +
      +
      +

      Parameters

      +
        +
      • +
        name: string
        +

        The name of the task function.

        +
        +
      +

      Returns Promise<boolean>

      true if the default task function was set, false otherwise.

      + +
    +
  • Defined in src/pools/abstract-pool.ts:580
  • +
  • Defined in src/pools/abstract-pool.ts:533
  • +
  • Defined in src/pools/abstract-pool.ts:552
  • -
    - -
    +
    + +
      +
    • -

      This method is the listener registered for each worker message.

      +

      Starts the minimum number of workers in this pool.

      -

      Returns ((message) => void)

      The listener function to execute when a message is received from a worker.

      - -
    +
    + +
      +
    • -

      This method is the listener registered for each worker message.

      +

      This method is the message listener registered on each worker.

      Parameters

      -

      Returns void

      The listener function to execute when a message is received from a worker.

      - -
    +

    Returns void

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

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file