X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIPool.html;h=b13db3bd94fe758b1c7995771be76339065a6d93;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=394e14c9f03a68fa75aa5f00554442a72060ac1e;hpb=53221c4e8cbcc585c670275e7c1c700c3d1b5f37;p=poolifier.git diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index 394e14c9..b13db3bd 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:158
  • +
    -
    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:146
  • +
    -
    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,66 +106,52 @@

          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:183
  • +
    -
    execute: ((data: Data) => Promise<Response>)
    +
    execute: ((data?, name?) => Promise<Response>)

    Type declaration

    • -
        -
      • (data: Data): Promise<Response>
      • +
          +
        • (data?, name?): 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.

            +
            Optional data: Data
            +

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

            +
          • +
          • +
            Optional name: string
            +

            The name of the worker function to execute. If not specified, the default worker function will be executed.

          -

          Returns Promise<Response>

    -
    - -
    findFreeWorkerNodeKey: (() => number)
    -
    -

    Type declaration

    -
      -
    • -
        -
      • (): number
      • -
      • -

        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.

        -
        -

        Returns number

    -
    +
  • Defined in src/pools/pool.ts:154
  • +
    -
    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 +159,21 @@

          Parameters

    Returns void

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

    Type declaration

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

          @@ -195,21 +181,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
            +

            The worker choice strategy options.

    Returns void

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

    Type declaration

    Returns void

    -
    +
  • Defined in src/pools/pool.ts:174
  • +
    + +
    size: number
    +

    Pool maximum size.

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

    Theme

    On This Page

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

    \ No newline at end of file