X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=f82f1fc3b8045fa92161f421312a9d7a19dec614;hb=41e3e08eb7fbcde0a69cea17e697aacb222990a6;hp=f6b1800ce6a2056215d39f5bdac260478d965252;hpb=ae782cfa994b2468b49e4279e03c5140e9e309e3;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index f6b1800c..3ea66d2b 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,13 +1,13 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier - v2.6.45
-
+
  • The search index is not available
  • poolifier - v2.6.45 +
    @@ -17,90 +17,103 @@

    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

    +
    +
    +

    Author

    Alessandro Pio Ardizio

    -

    Since

    0.0.1

    +

    Since

    0.0.1

    Type Parameters

    • 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

    - +
      - +
    • Constructs a new poolifier fixed thread pool.

      @@ -117,165 +130,232 @@
    • numberOfThreads: number

      Number of threads for this pool.

      -
    • +
    +
  • filePath: string

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

    -
  • +
    +
  • -
    opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
    +
    opts: ThreadPoolOptions = {}

    Options for this fixed thread pool.

    -
  • -

    Returns FixedThreadPool<Data, Response>

    Properties

    - +
    emitter?: PoolEmitter

    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:68
  • +
    +
    filePath: string

    Path to the worker file.

    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:116
  • +
    + +
    max?: number
    +

    Dynamic pool maximum size property placeholder.

    +
    +
    +
    +
    numberOfWorkers: number

    Number of workers that this pool should manage.

    -
    -
    - - -

    Options for the pool.

    -
    +
    + + +

    Options for this fixed thread pool.

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

    • key: The message id of each submitted task.
    • value: An object that contains the worker, the execution response promise resolve and reject callbacks.

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

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

    Pool worker nodes.

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

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

    Methods

    - + +

    Returns void

    +
    -
    - -
    +
    + + +

    Returns void

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

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:905
  • +
    +
    +
    + +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:1152
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:1108
  • - +
    +
  • Defined in src/pools/thread/fixed.ts:117
  • - +
    -
    - +
  • Defined in src/pools/abstract-pool.ts:850
  • +
    + +

    Returns Promise<void>

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

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    -
    +
  • Defined in src/pools/abstract-pool.ts:779
  • +
    + +
    +
    + +
    +
    + +
    - +
    +
  • Defined in src/pools/abstract-pool.ts:738
  • - +
    +
  • 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:650
  • - + +

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:622
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:889
  • +
    + +
    - +
    +
  • Defined in src/pools/abstract-pool.ts:1372
  • -

    On This Page

    +

    On This Page

    +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • ready
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerNodeSetup
  • +
  • beforeTaskExecutionHook
  • +
  • checkDynamicPoolSize
  • +
  • createAndSetupDynamicWorkerNode
  • +
  • createAndSetupWorkerNode
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorkerNode
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • flushTasksQueue
  • +
  • getWorkerInfo
  • +
  • hasWorkerNodeBackPressure
  • +
  • internalBusy
  • +
  • isMain
  • +
  • listTaskFunctions
  • +
  • registerWorkerMessageListener
  • +
  • sendKillMessageToWorker
  • +
  • sendStartupMessageToWorker
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • start
  • +
  • workerListener
  • +
    -

    Generated using TypeDoc

    -
    \ No newline at end of file +

    Generated using TypeDoc

    +
    \ No newline at end of file