X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedClusterPool.html;h=15f01272545e185515b0038899441c4f564cdfe6;hb=76b46937556ea55049d5c413aa0a77d0c7f47f48;hp=7cb87fa3afc73f600a7b47574969cd6f8a735f81;hpb=8d98e603c79d8d00b2b6a33e5f732701a7466234;p=poolifier.git diff --git a/docs/classes/FixedClusterPool.html b/docs/classes/FixedClusterPool.html index 7cb87fa3..15f01272 100644 --- a/docs/classes/FixedClusterPool.html +++ b/docs/classes/FixedClusterPool.html @@ -1,4 +1,4 @@ -FixedClusterPool | poolifier
+FixedClusterPool | poolifier - v2.6.19
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.19
    @@ -17,24 +17,25 @@

    Class FixedClusterPool<Data, Response>

    A cluster pool with a fixed number of workers.

    -

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

    -

    This pool selects the workers in a round robin fashion.

    - -

    Author

    Christopher Quadflieg

    +
    +
    +

    Author

    Christopher Quadflieg

    -

    Since

    2.0.0

    +

    Since

    2.0.0

    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/cluster/fixed.ts:33
  • @@ -52,56 +53,62 @@

    Constructors

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

      @@ -118,62 +125,71 @@
    • numberOfWorkers: number

      Number of workers for this pool.

      -
    • +
    +
  • filePath: string

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

    -
  • + +
  • opts: ClusterPoolOptions = {}

    Options for this fixed cluster pool.

    -
  • -

    Returns FixedClusterPool<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.
    • +
    • '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 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.
    -
    +
  • Defined in src/pools/abstract-pool.ts:64
  • - +
    filePath: string

    Path to the worker file.

    -
    +
  • Defined in src/pools/abstract-pool.ts:106
  • - +
    numberOfWorkers: number

    Number of workers that this pool should manage.

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

    Options for this fixed cluster pool.

    -
    +
  • Defined in src/pools/cluster/fixed.ts:47
  • - +
    promiseResponseMap: Map<string, PromiseResponseWrapper<Worker, Response>> = ...

    The execution response promise map.

      @@ -181,115 +197,146 @@
    • 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:74
  • - +
    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<Worker, Data>[] = []
    + +
    workerNodes: IWorkerNode<Worker, Data>[] = []

    Pool worker nodes.

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

    - +
    • get busy(): boolean
    • Whether the pool is busy or not.

      The pool busyness boolean status.

      -

      Returns boolean

    +
  • Defined in src/pools/cluster/fixed.ts:118
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:591
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:294
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:113
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:108
  • +
    + +
    - +
    +
  • Defined in src/pools/cluster/fixed.ts:98
  • +
    + +
    - +
    +
  • Defined in src/pools/cluster/fixed.ts:103
  • Methods

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

      @@ -300,22 +347,25 @@ Can be overridden.

    • worker: Worker

      The worker.

      -
    • + +
    • -
      message: MessageValue<Response, Worker | MessagePort>
      +
      message: MessageValue<Response, unknown>

      The received message.

      -
    -

    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.

      +

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

      Parameters

      @@ -323,15 +373,17 @@ Can be overridden.

    • worker: Worker

      The newly created worker.

      -
    -

    Returns void

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

    Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:696
  • +
    +
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:896
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:856
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:93
  • - +
    +
  • Defined in src/pools/abstract-pool.ts:651
  • - + -

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:63
  • - + -

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

    -
    +
  • Defined in src/pools/abstract-pool.ts:616
  • +
    + +
    +
    + +
    - +
    +
  • Defined in src/pools/abstract-pool.ts:607
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:58
  • - + -

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:85
  • +
    + +
    - + -

    Returns void

    +
  • Defined in src/pools/cluster/fixed.ts:72
  • - + -

    Returns void

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

    Returns void

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

    Returns void

    +
  • Defined in src/pools/abstract-pool.ts:545
  • - +
    +
  • Defined in src/pools/cluster/fixed.ts:53
  • - +

    Returns void

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

    -
    +
  • Defined in src/pools/abstract-pool.ts:992
  • +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • info
  • +
  • maxSize
  • +
  • minSize
  • +
  • ready
  • +
  • type
  • +
  • utilization
  • +
  • worker
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • checkDynamicPoolSize
  • +
  • createAndSetupDynamicWorker
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • getWorkerInfoByWorker
  • +
  • getWorkerNodeKey
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendStartupMessageToWorker
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • Queue
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • EventLoopUtilizationMeasurementStatistics
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • IWorkerNode
  • +
  • MeasurementOptions
  • +
  • MeasurementStatistics
  • +
  • MeasurementStatisticsRequirements
  • +
  • MessageValue
  • +
  • PoolInfo
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • StrategyPolicy
  • +
  • Task
  • +
  • TaskError
  • +
  • TaskPerformance
  • +
  • TaskStatistics
  • +
  • TaskStatisticsRequirements
  • +
  • TasksQueueOptions
  • +
  • ThreadPoolOptions
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerInfo
  • +
  • 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