X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=76ccf9cf047bf35c7ee11d02c6eb7af5e0e12f4b;hb=2a6631992868d900762f62e4c228dce4e4ee549a;hp=02db47b5bcc24a322c2626872cee8701ae48f47e;hpb=938d9c678aa8e70e5642feffb90604cf25c993fe;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 02db47b5..76ccf9cf 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -19,22 +19,25 @@

A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

This thread pool creates new threads when the others are busy, up to the maximum number of threads. When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

+
+
+

Author

Alessandro Pio Ardizio

-

Author

Alessandro Pio Ardizio

- -

Since

0.0.1

+

Since

0.0.1

-
+

Type Parameters

-
+

Type of execution response. This can only be structured-cloneable data.

+
+

Hierarchy

+
  • Defined in src/pools/thread/dynamic.ts:15
  • @@ -50,61 +53,64 @@ When the maximum number of threads is reached and workers are busy, an event is

    Constructors

    - +
    +
  • Defined in src/pools/thread/dynamic.ts:27
  • 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.
    • +
    • 'error': Emitted when an uncaught error occurs.
    • +
    • 'taskError': Emitted when an error occurs while executing a task.
    -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:58
  • +
    +
    filePath: string

    Path to the worker file.

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

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

    -
    -
    - +
  • Defined in src/pools/thread/dynamic.ts:29
  • +
    +
    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:51
  • - -
    promiseResponseMap: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    + +
    promiseResponseMap: Map<string, PromiseResponseWrapper<Worker, Response>> = ...

    The execution response promise map.

    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:68
  • - -
    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:76
  • - -
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
    + +
    workerNodes: WorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    - +
    -
    - -
    +
    + +
    -
    - -
    +
    + +
    +
    + +
    -
    - +
  • Defined in src/pools/thread/dynamic.ts:42
  • +
    + +
    +
    +
    -
    - -
    +
    + +
    +
  • Defined in src/pools/thread/dynamic.ts:37
  • +
    + +
    +
    + +

    Methods

    - + -

    Returns void

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

    Returns void

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

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:539
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:790
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:757
  • - +
    +
  • Defined in src/pools/thread/fixed.ts:73
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:500
  • - + +

    Returns Promise<void>

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

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    + +
    +
  • Defined in src/pools/abstract-pool.ts:466
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:457
  • - +
    -
    - -
    +
  • Defined in src/pools/thread/fixed.ts:57
  • - + +

    Returns void

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

    Returns void

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

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:395
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:523
  • - + +
    +
  • Defined in src/pools/abstract-pool.ts:815
  • +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • runTime
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • createAndSetupDynamicWorker
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • internalBusy
  • +
  • isMain
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • EventLoopUtilizationMeasurementStatistics
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • MeasurementOptions
  • +
  • MeasurementStatistics
  • +
  • MeasurementStatisticsRequirements
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • StrategyPolicy
  • +
  • Task
  • +
  • TaskError
  • +
  • TaskPerformance
  • +
  • TaskStatistics
  • +
  • TaskStatisticsRequirements
  • +
  • TasksQueueOptions
  • +
  • ThreadPoolOptions
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerInfo
  • +
  • WorkerNode
  • +
  • WorkerOptions
  • +
  • WorkerStatistics
  • +
  • WorkerUsage
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • Measurement
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskFunctions
  • +
  • WorkerAsyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerFunction
  • +
  • WorkerSyncFunction
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • Measurements
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file