X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIPool.html;h=1135bfdc7c48600d194d29e380410af18d594b98;hb=c9f8e5d3a3d92ae49257929ad172afc1e9c5630d;hp=7efd9779ab1e386b03c87ca8ffb0a7f53c7749e9;hpb=6709f3086622c12bae8060915be7a7f6be9d9763;p=poolifier.git diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index 7efd9779..1135bfdc 100644 --- a/docs/interfaces/IPool.html +++ b/docs/interfaces/IPool.html @@ -1,4 +1,4 @@ -IPool | poolifier
+IPool | poolifier - v2.6.28
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • poolifier - v2.6.28
    @@ -17,22 +17,26 @@

    Interface IPool<Worker, Data, Response>

    Contract definition for a poolifier pool.

    -
    -
    +
    +
    +

    Type Parameters

    -
    +

    Response = unknown

    +

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

    +
    +

    Hierarchy

    +
  • Defined in src/pools/pool.ts:169
  • @@ -50,55 +54,61 @@

    Properties

    -
    - -
    destroy: (() => Promise<void>)
    +
    + +
    destroy: (() => Promise<void>)

    Type declaration

    • -
        -
      • (): Promise<void>
      • +
          +
        • (): Promise<void>
        • -

          Shutdowns every current worker in this pool.

          +

          Terminates all workers in this pool.

          -

          Returns Promise<void>

    -
    - -
    emitter?: PoolEmitter
    +
  • Defined in src/pools/pool.ts:211
  • +
    + +
    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 at least one task.
    • +
    • '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.
    -
    -
    - -
    enableTasksQueue: ((enable: boolean, opts?: TasksQueueOptions) => void)
    +
  • Defined in src/pools/pool.ts:194
  • +
    + +
    enableTasksQueue: ((enable, tasksQueueOptions?) => void)

    Type declaration

    • -
        -
      • (enable: boolean, opts?: TasksQueueOptions): void
      • +
          +
        • (enable, tasksQueueOptions?): void
        • Enables/disables the worker tasks queue in this pool.

          @@ -106,66 +116,88 @@

          Parameters

          • -
            enable: boolean
            +
            enable: boolean

            Whether to enable or disable the worker tasks queue.

            -
          • +
    +
  • -
    Optional opts: TasksQueueOptions
  • -

    Returns void

    -
    - -
    execute: ((data: Data) => Promise<Response>)
    +
  • Defined in src/pools/pool.ts:242
  • +
    + +
    execute: ((data?, name?, transferList?) => Promise<Response>)

    Type declaration

    • -
        -
      • (data: Data): Promise<Response>
      • +
          +
        • (data?, name?, transferList?): Promise<Response>
        • -

          Executes the function specified in the constructor with the task data parameter.

          - -

          Returns

          Promise that will be resolved when the task is successfully completed.

          +

          Executes the specified function in the worker constructor with the task data input parameter.

          Parameters

          • -
            data: Data
            -

            The input for the specified task. This can only be serializable data.

            -
          -

          Returns Promise<Response>

    -
    - -
    findFreeWorkerNodeKey: (() => number)
    +
  • Defined in src/pools/pool.ts:203
  • +
    + +
    info: PoolInfo
    +

    Pool information.

    +
    +
    +
    + +
    listTaskFunctions: (() => string[])

    Type declaration

    • -
        -
      • (): number
      • +
          +
        • (): string[]
        • -

          Finds a free worker node key based on the number of tasks the worker has applied.

          -

          If a worker is found with 0 running tasks, it is detected as free and its worker node key is returned.

          -

          If no free worker is found, -1 is returned.

          - -

          Returns

          A worker node key if there is one, -1 otherwise.

          +

          Lists the names of task function available in this pool.

          -

          Returns number

    -
    - -
    setTasksQueueOptions: ((tasksQueueOptions: TasksQueueOptions) => void)
    +
  • Defined in src/pools/pool.ts:217
  • +
    + +
    setTasksQueueOptions: ((tasksQueueOptions) => void)

    Type declaration

    • -
        -
      • (tasksQueueOptions: TasksQueueOptions): void
      • +
          +
        • (tasksQueueOptions): void
        • Sets the worker tasks queue options in this pool.

          @@ -173,21 +205,23 @@

          Parameters

    -

    Returns void

    -
    - -
    setWorkerChoiceStrategy: ((workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions) => void)
    +
  • Defined in src/pools/pool.ts:251
  • +
    + +
    setWorkerChoiceStrategy: ((workerChoiceStrategy, workerChoiceStrategyOptions?) => void)

    Type declaration

    • -
        -
      • (workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions): void
      • +
          +
        • (workerChoiceStrategy, workerChoiceStrategyOptions?): void
        • Sets the worker choice strategy in this pool.

          @@ -195,25 +229,28 @@

          Parameters

          • -
            workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"
            +
            workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "LEAST_ELU" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

            The worker choice strategy.

            -
          • +
    +
  • -
    Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
    +
    Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions

    The worker choice strategy options.

    -
  • -

    Returns void

    -
    - -
    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions: WorkerChoiceStrategyOptions) => void)
    +
  • Defined in src/pools/pool.ts:224
  • +
    + +
    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions) => void)

    Type declaration

    -

    Returns void

    -
    - -
    type: PoolType
    -

    Pool type.

    -

    If it is 'dynamic', it provides the max property.

    -
    -
    - -
    workerNodes: WorkerNode<Worker, Data>[]
    +
  • Defined in src/pools/pool.ts:233
  • +
    + +
    workerNodes: IWorkerNode<Worker, Data>[]

    Pool worker nodes.

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

    On This Page

    +

    On This Page

    +
  • destroy
  • +
  • emitter
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • info
  • +
  • listTaskFunctions
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • workerNodes
  • +
  • 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
  • +
  • KillHandler
  • +
  • Measurement
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • PoolType
  • +
  • TaskAsyncFunction
  • +
  • TaskFunction
  • +
  • TaskFunctions
  • +
  • TaskSyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerType
  • +
  • KillBehaviors
  • +
  • Measurements
  • +
  • PoolEvents
  • +
  • PoolTypes
  • +
  • WorkerChoiceStrategies
  • +
  • WorkerTypes
  • +
  • availableParallelism
  • Generated using TypeDoc

    \ No newline at end of file