X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIPool.html;h=b13db3bd94fe758b1c7995771be76339065a6d93;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=0b232f29be2d00227a28ed520f67771f3a571334;hpb=6c525543a7ed67a926b7c1f4bf98985aaad1f088;p=poolifier.git diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index 0b232f29..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:

      @@ -96,67 +89,91 @@
    -
    - -
    execute: ((data: Data) => Promise<Response>)
    +
  • Defined in src/pools/pool.ts:146
  • +
    + +
    enableTasksQueue: ((enable, tasksQueueOptions?) => void)

    Type declaration

    • -
        -
      • (data: Data): Promise<Response>
      • +
          +
        • (enable, tasksQueueOptions?): void
        • -

          Performs the task specified in the constructor with the data parameter.

          - -

          Returns

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

          +

          Enables/disables the worker tasks queue in this pool.

          Parameters

          • -
            data: Data
            -

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

            +
            enable: boolean
            +

            Whether to enable or disable the worker tasks queue.

            +
          • +
          • +
            Optional tasksQueueOptions: TasksQueueOptions
            +

            The worker tasks queue options.

          -

          Returns Promise<Response>

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

    Type declaration

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

          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.

          +

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

          -

          Returns number

    -
    - -
    full: boolean
    -

    Whether the pool is full or not.

    -

    The pool filling boolean status.

    -
    +
    + +
    setTasksQueueOptions: ((tasksQueueOptions) => void)
    +
    +

    Type declaration

    +
      +
    • +
        +
      • (tasksQueueOptions): void
      • +
      • +

        Sets the worker tasks queue options in this pool.

        +
        +
        +

        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.

          @@ -164,27 +181,60 @@

          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

    +
    + +
    setWorkerChoiceStrategyOptions: ((workerChoiceStrategyOptions) => void)
    +
    +

    Type declaration

    +
      +
    • +
        +
      • (workerChoiceStrategyOptions): void
      • +
      • +

        Sets the worker choice strategy options in this pool.

        +
        +
        +

        Parameters

        +

        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