X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=1836da110382c4470026ee64325e36d2676c6b9a;hb=1cc6e9ef64f399f4ca58da8079ef72a011ac4227;hp=5d0045b7e211049cc1e627a05a865acbb21a923a;hpb=71056a0ac555e096c1428d6341ef45c7980a6332;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 5d0045b7..1836da11 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,13 +1,13 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier - v2.7.5
-
+
  • The search index is not available
  • poolifier - v2.7.5 +
    @@ -17,8 +17,6 @@

    Class FixedThreadPool<Data, Response>

    A thread pool with a fixed number of threads.

    -

    It is possible to perform tasks in sync or asynchronous mode as you prefer.

    -

    This pool selects the threads in a round robin fashion.

    Author

    Alessandro Pio Ardizio

    @@ -30,37 +28,38 @@
    • 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.

    Hierarchy

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

    Constructors

    - +
    +
  • Defined in src/pools/thread/fixed.ts:46
  • 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 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 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:73
  • filePath: string
    @@ -164,7 +182,16 @@
    +
  • Defined in src/pools/abstract-pool.ts:128
  • +
    + +
    max?: number
    +

    Dynamic pool maximum size property placeholder.

    +
    +
    numberOfWorkers: number
    @@ -173,7 +200,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:127
  • @@ -182,11 +209,11 @@
    +
  • Defined in src/pools/thread/fixed.ts:49
  • -
    promiseResponseMap: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    -

    The execution response promise map.

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

    The task execution response promise map:

    +
  • Defined in src/pools/abstract-pool.ts:82
  • -
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>
    +
    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:88
  • - -
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    @@ -230,7 +256,7 @@
    +
  • Defined in src/pools/thread/fixed.ts:154
  • +
  • Defined in src/pools/abstract-pool.ts:651
  • -
    +
  • Defined in src/pools/abstract-pool.ts:271
  • +
    -
      +
      • get maxSize(): number
      • -

        Pool maximum size.

        +

        The pool maximum size.

        Returns number

    -
    +
  • Defined in src/pools/abstract-pool.ts:484
  • +
    -
      +
      • get minSize(): number
      • -

        Pool minimum size.

        +

        The pool minimum size.

        Returns number

    +
  • Defined in src/pools/abstract-pool.ts:477
  • +
    + +
      +
    • get ready(): boolean
    • +
    • +

      The pool readiness boolean status.

      +
      +

      Returns boolean

      +
    • 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:144
  • +
    + +
      +
    • get utilization(): number
    • +
    • +

      The approximate pool utilization.

      +
      +

      Returns number

      The pool utilization.

      + +
      -
    • 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:149
  • Methods

    +
    + +
    -
    - -
    +
    + +
      +
    • -

      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

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:1344
    • - +
    • Hook executed before the worker task execution. Can be overridden.

      @@ -369,112 +451,158 @@ Can be overridden.

      workerNodeKey: number

      The worker node key.

      +
    • +
    • +
      task: Task<Data>
      +

      The task to execute.

      +

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:1003
  • +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1250
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1206
  • +
  • Defined in src/pools/thread/fixed.ts:136
  • +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:940
  • +
    +
    +
  • Defined in src/pools/thread/fixed.ts:60
  • +
  • Defined in src/pools/abstract-pool.ts:565
  • Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    @@ -496,16 +629,97 @@ Can be overridden.

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

    Returns void

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:106
  • +
    + +
    +
    + +
    +
    + +
    +
  • Defined in src/pools/thread/fixed.ts:77
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:579
  • +
  • Defined in src/pools/abstract-pool.ts:532
  • +
  • Defined in src/pools/abstract-pool.ts:551
  • +
  • Defined in src/pools/abstract-pool.ts:987
  • +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:1495
  • @@ -712,6 +1073,7 @@ Can be overridden

  • constructor
  • emitter
  • filePath
  • +
  • max
  • numberOfWorkers
  • opts
  • promiseResponseMap
  • @@ -720,82 +1082,69 @@ Can be overridden

  • busy
  • full
  • info
  • -
  • maxSize
  • -
  • minSize
  • +
  • maxSize
  • +
  • minSize
  • +
  • ready
  • type
  • +
  • utilization
  • worker
  • +
  • addTaskFunction
  • afterTaskExecutionHook
  • -
  • afterWorkerSetup
  • +
  • afterWorkerNodeSetup
  • beforeTaskExecutionHook
  • -
  • chooseWorkerNode
  • -
  • createAndSetupWorker
  • +
  • createAndSetupDynamicWorkerNode
  • +
  • createAndSetupWorkerNode
  • createWorker
  • +
  • deregisterWorkerMessageListener
  • destroy
  • -
  • destroyWorker
  • +
  • destroyWorkerNode
  • enableTasksQueue
  • execute
  • +
  • flushTasksQueue
  • +
  • getWorkerInfo
  • +
  • hasTaskFunction
  • +
  • hasWorkerNodeBackPressure
  • internalBusy
  • isMain
  • +
  • listTaskFunctionNames
  • +
  • registerOnceWorkerMessageListener
  • registerWorkerMessageListener
  • +
  • removeTaskFunction
  • +
  • sendKillMessageToWorker
  • +
  • sendStartupMessageToWorker
  • sendToWorker
  • +
  • setDefaultTaskFunction
  • setTasksQueueOptions
  • setWorkerChoiceStrategy
  • setWorkerChoiceStrategyOptions
  • setupHook
  • +
  • start
  • workerListener
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file