X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIPool.html;h=c6e2995e72f26d899d8bb6aaed60a5b8c82f28e3;hb=8d1797ad15cb2d87ac3c9904ce6df3db45c0c742;hp=7efd9779ab1e386b03c87ca8ffb0a7f53c7749e9;hpb=a8aeac440fb425585a0d597af86f616e648ae156;p=poolifier.git diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index 7efd9779..c6e2995e 100644 --- a/docs/interfaces/IPool.html +++ b/docs/interfaces/IPool.html @@ -1,4 +1,4 @@ -IPool | poolifier
+IPool | poolifier
-
+
  • Defined in src/pools/pool.ts:163
  • +
    -
    emitter?: PoolEmitter
    +
    emitter?: PoolEmitter

    Emitter on which events can be listened to.

    Events that can currently be listened to:

      @@ -89,16 +89,16 @@
    -
    +
  • Defined in src/pools/pool.ts:142
  • +
    -
    enableTasksQueue: ((enable: boolean, opts?: TasksQueueOptions) => void)
    +
    enableTasksQueue: ((enable, tasksQueueOptions?) => void)

    Type declaration

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

          @@ -106,46 +106,48 @@

          Parameters

          • -
            enable: boolean
            +
            enable: boolean

            Whether to enable or disable the worker tasks queue.

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

    The worker tasks queue options.

    +

    Returns void

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

    Type declaration

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

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

          +

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

          -

          Returns

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

          +

          Returns

          Promise that will be fulfilled when the task is completed.

          Parameters

          • -
            data: Data
            -

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

            +
            Optional data: Data
            +

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

          -

          Returns Promise<Response>

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

    Type declaration

    • -
        +
        • (): number
        • Finds a free worker node key based on the number of tasks the worker has applied.

          @@ -156,16 +158,16 @@

          Returns number

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

    Type declaration

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

          @@ -173,21 +175,21 @@

          Parameters

    Returns void

    -
    +
  • Defined in src/pools/pool.ts:197
  • +
    -
    setWorkerChoiceStrategy: ((workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN", workerChoiceStrategyOptions?: WorkerChoiceStrategyOptions) => void)
    +
    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 +197,25 @@

          Parameters

          • -
            workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"
            +
            workerChoiceStrategy: "ROUND_ROBIN" | "LESS_USED" | "LESS_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN"

            The worker choice strategy.

          • -
            Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
            +
            Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions

            The worker choice strategy options.

    Returns void

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

    Type declaration

    Returns void

    -
    +
  • Defined in src/pools/pool.ts:179
  • +
    -
    type: PoolType
    +
    type: PoolType

    Pool type.

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

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

    Pool worker nodes.

    +
  • Defined in src/pools/pool.ts:133
  • +

    Theme

    On This Page

    +
  • destroy
  • +
  • emitter
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • findFreeWorkerNodeKey
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • type
  • +
  • workerNodes
  • +
  • PoolType
  • +
  • AbstractPool
  • +
  • AbstractWorker
  • +
  • CircularArray
  • +
  • ClusterWorker
  • +
  • DynamicClusterPool
  • +
  • DynamicThreadPool
  • +
  • FixedClusterPool
  • +
  • FixedThreadPool
  • +
  • PoolEmitter
  • +
  • ThreadWorker
  • +
  • WorkerChoiceStrategyContext
  • +
  • ClusterPoolOptions
  • +
  • IPool
  • +
  • IWorker
  • +
  • IWorkerChoiceStrategy
  • +
  • MessageValue
  • +
  • PoolOptions
  • +
  • PromiseResponseWrapper
  • +
  • RequiredStatistics
  • +
  • Task
  • +
  • TasksQueueOptions
  • +
  • TasksUsage
  • +
  • WorkerChoiceStrategyOptions
  • +
  • WorkerNode
  • +
  • WorkerOptions
  • +
  • Draft
  • +
  • ErrorHandler
  • +
  • ExitHandler
  • +
  • KillBehavior
  • +
  • MessageHandler
  • +
  • OnlineHandler
  • +
  • PoolEvent
  • +
  • ThreadWorkerWithMessageChannel
  • +
  • WorkerAsyncFunction
  • +
  • WorkerChoiceStrategy
  • +
  • WorkerFunction
  • +
  • WorkerSyncFunction
  • +
  • KillBehaviors
  • +
  • PoolEvents
  • +
  • WorkerChoiceStrategies
  • Generated using TypeDoc

    \ No newline at end of file