X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=5f3005ffccbc63730c4117fd06db226d3a0ec71f;hb=3c7c9bd12cf4b0cec0e0a3825c31f7cc9f3f58fe;hp=8a305a137c989bb178be31d253d012845f225bc0;hpb=04cb7adbacc7fb0d1b76db6122f86c52e33d136d;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 8a305a13..5f3005ff 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier - v2.6.10
+FixedThreadPool | poolifier - v2.6.21
  • Preparing search index...
  • -
  • The search index is not available
poolifier - v2.6.10
+
  • The search index is not available
  • poolifier - v2.6.21
    @@ -45,7 +45,7 @@ +
  • Defined in src/pools/thread/fixed.ts:34
  • @@ -73,7 +73,6 @@ maxSize minSize ready -starting type utilization worker @@ -81,18 +80,22 @@

    Methods

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

    @@ -148,7 +151,7 @@

    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 maximum size expected and are ready.
    • +
    • '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.
    • 'error': Emitted when an uncaught error occurs.
    • 'taskError': Emitted when an error occurs while executing a task.
    • @@ -157,7 +160,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:64
  • filePath: string
    @@ -166,7 +169,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:104
  • numberOfWorkers: number
    @@ -175,7 +178,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:103
  • @@ -184,11 +187,11 @@
    +
  • Defined in src/pools/thread/fixed.ts:48
  • -
    promiseResponseMap: Map<string, PromiseResponseWrapper<Worker, Response>> = ...
    -

    The execution response promise map.

    +
    promiseResponseMap: Map<string, PromiseResponseWrapper<Response>> = ...
    +

    The task execution response promise map.

    +
  • Defined in src/pools/abstract-pool.ts:74
  • workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
    @@ -207,7 +210,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:80
  • workerNodes: IWorkerNode<Worker, Data>[] = []
    @@ -216,7 +219,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:61
  • Accessors

    @@ -231,7 +234,7 @@
    +
  • Defined in src/pools/thread/fixed.ts:140
  • +
  • Defined in src/pools/abstract-pool.ts:606
  • +
  • Defined in src/pools/abstract-pool.ts:301
    • get maxSize(): number
    • -

      Pool maximum size.

      +

      The pool maximum size.

      Returns number

    +
  • Defined in src/pools/thread/fixed.ts:135
    • get minSize(): number
    • -

      Pool minimum size.

      +

      The pool minimum size.

      Returns number

    +
  • Defined in src/pools/thread/fixed.ts:130
    • get ready(): boolean
    • -

      Returns boolean

    -
    - -
    +
  • Defined in src/pools/abstract-pool.ts:444
    • get type(): "fixed" | "dynamic"
    • -

      Pool type.

      +

      The pool type.

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

      Returns "fixed" | "dynamic"

    +
  • Defined in src/pools/thread/fixed.ts:120
    • get utilization(): number
    • -

      Gets the approximate pool utilization.

      +

      The approximate pool utilization.

      Returns number

      The pool utilization.

    +
  • Defined in src/pools/abstract-pool.ts:461
    • -
    • get worker(): "cluster" | "thread"
    • +
    • get worker(): "thread" | "cluster"
    • -

      Gets the worker type.

      +

      The worker type.

      -

      Returns "cluster" | "thread"

      +

      Returns "thread" | "cluster"

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

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

      @@ -351,8 +348,8 @@ Can be overridden.

      Parameters

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

      Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes. +

      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:951
  • +
  • Defined in src/pools/abstract-pool.ts:701
  • -
    - +
  • Defined in src/pools/abstract-pool.ts:173
  • +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:900
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:860
  • +
  • Defined in src/pools/thread/fixed.ts:112
  • -
    - +
  • Defined in src/pools/abstract-pool.ts:664
  • +
    +
      - +
    • -

      Terminates the given worker.

      +

      Terminates the worker node given its worker node key.

      Parameters

      • -
        worker: Worker
        -

        A worker within workerNodes.

        +
        workerNodeKey: number
        +

        The worker node key.

      Returns Promise<void>

    +
  • Defined in src/pools/thread/fixed.ts:59
  • +
  • Defined in src/pools/abstract-pool.ts:571
    • @@ -536,12 +533,12 @@ Can be overridden.

      • Optional data: Data
        -

        The task input data for the specified worker function. This can only be structured-cloneable data.

        +

        The task input data for the specified task function. This can only be structured-cloneable data.

      • Optional name: string
        -

        The name of the worker function to execute. If not specified, the default worker function will be executed.

        +

        The name of the task function to execute. If not specified, the default task function will be executed.

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    @@ -549,7 +546,42 @@ Can be overridden.

    +
  • Defined in src/pools/abstract-pool.ts:632
  • +
    + +
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:622
  • +
  • Defined in src/pools/thread/fixed.ts:54
  • +
    + +
      + +
    • +

      Registers 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

      +
    +
    + +
      - +
    • -

      Sends a message to the given worker.

      +

      Sends a message to worker given its worker node key.

      Parameters

    +
  • Defined in src/pools/thread/fixed.ts:76
  • +
  • Defined in src/pools/abstract-pool.ts:583
  • +
  • Defined in src/pools/abstract-pool.ts:541
  • +
  • Defined in src/pools/abstract-pool.ts:560
  • +
  • Defined in src/pools/abstract-pool.ts:685
    • -

      This function is the listener registered for each worker message.

      +

      This method is the listener registered for each worker message.

      Returns ((message) => void)

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

      @@ -692,7 +785,7 @@ Can be overridden.

      • (message): void
      • -

        This function is the listener registered for each worker message.

        +

        This method is the listener registered for each worker message.

        Parameters

        @@ -705,7 +798,7 @@ Can be overridden.

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