X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=e4b8baf600b1d6ebfe12de36b84e224801541689;hb=010ae1ba98e5ab018fa09870982d511c9389b48b;hp=c94a503a31bdd7a4a161b872c6717e79eab178ef;hpb=f45a3823ad04902b4c446c7c7de55ca183041953;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index c94a503a..e4b8baf6 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier - v2.6.37
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.37
    @@ -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,24 +28,24 @@
    • 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
  • @@ -61,6 +59,7 @@

    Properties

    Methods

  • filePath: string

    Path to an implementation of a ThreadWorker file, which can be relative or absolute.

    -
    -
  • +
  • opts: ThreadPoolOptions = {}

    Options for this fixed thread pool.

    -
    -
  • +

    Returns FixedThreadPool<Data, Response>

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

    @@ -146,16 +151,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 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:66
  • filePath: string
    @@ -164,7 +172,16 @@
    +
  • Defined in src/pools/abstract-pool.ts:115
  • +
    + +
    max?: number
    +

    Dynamic pool maximum size property placeholder.

    +
    +
    numberOfWorkers: number
    @@ -173,7 +190,7 @@
    +
  • Defined in src/pools/abstract-pool.ts:114
  • @@ -182,11 +199,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:76
  • -
    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:82
  • - -
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    @@ -230,7 +246,7 @@
    +
  • Defined in src/pools/thread/fixed.ts:135
  • +
  • Defined in src/pools/abstract-pool.ts:687
  • -
    +
  • Defined in src/pools/abstract-pool.ts:348
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:560
  • +
    -
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:505
  • +
  • Defined in src/pools/thread/fixed.ts:125
  • +
    + +
    +
  • Defined in src/pools/thread/fixed.ts:130
  • Methods

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

      @@ -319,45 +360,42 @@ Can be overridden.

      Parameters

      +

    Returns void

    -
    - -
    +
    + +
      +
    • -

      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

      +
      workerNodeKey: number
      +

      The newly created worker node key.

      +

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:1160
  • + +
  • +
    task: Task<Data>
    +

    The task to execute.

    +
  • Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:856
  • +
    + +
    +
    +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1103
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1059
  • +
  • Defined in src/pools/thread/fixed.ts:117
  • -
    - +
  • Defined in src/pools/abstract-pool.ts:801
  • +
    +

    Returns Promise<void>

    +
  • Defined in src/pools/thread/fixed.ts:60
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:641
  • Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

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

    Returns void

    Returns void

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

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:80
  • Returns void

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

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:627
  • +
  • Defined in src/pools/abstract-pool.ts:840
  • +
  • Defined in src/pools/abstract-pool.ts:1328
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • -

    Generated using TypeDoc

    +

    Generated using TypeDoc

    \ No newline at end of file