X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicClusterPool.html;h=6383bbff27f10fe587f8d7256ef7c439111292d4;hb=fbc22127e53d3ec0ecbd38ecea25fb92ebef50e7;hp=0e641c77ed6e931037f137ecdfc4d40acc918494;hpb=1d6ec394e8f7467f72baeb74dda4794fdc5ab322;p=poolifier.git diff --git a/docs/classes/DynamicClusterPool.html b/docs/classes/DynamicClusterPool.html index 0e641c77..6383bbff 100644 --- a/docs/classes/DynamicClusterPool.html +++ b/docs/classes/DynamicClusterPool.html @@ -1,4 +1,4 @@ -DynamicClusterPool | poolifier
+DynamicClusterPool | poolifier

Returns 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>

-
- -
+
+ +
    +
  • -

    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.

    +

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

    -

    Returns

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

    +

    Returns

    Promise that will be fulfilled when the task is completed.

    -

    Returns number

-
+
  • Defined in src/pools/abstract-pool.ts:307
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:298
  • +
    -
    -
    +
  • Defined in src/pools/cluster/fixed.ts:64
  • +
    -
      - +
        +
      • Registers a listener callback on the given worker.

        @@ -462,37 +471,37 @@ Can be overridden.

        Type Parameters

        • -

          Message

    +

    Message

    Parameters

    • -
      worker: Worker
      +
      worker: Worker

      The worker which should register a listener.

    • -
      listener: ((message: MessageValue<Message, unknown>) => void)
      +
      listener: ((message) => void)

      The message listener callback.

    Returns void

    Returns void

    -
    +
  • Defined in src/pools/cluster/fixed.ts:80
  • +
    -
      - +
    -
    +
  • Defined in src/pools/cluster/fixed.ts:75
  • +
    + +
    +
    -
      - +
        +
      • Sets the worker choice strategy in this pool.

        @@ -522,17 +549,39 @@ Can be overridden.

        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/abstract-pool.ts:218
  • +
    + +
    +
    -
      - +
    -
    +
  • Defined in src/pools/cluster/fixed.ts:59
  • +
    -
      - +
        +
      • This function is the listener registered for each worker message.

        Returns

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

        -

        Returns ((message: MessageValue<Response, unknown>) => void)

        +

        Returns ((message) => void)

        • -
            -
          • (message: MessageValue<Response, unknown>): void
          • +
              +
            • (message): void
            • This function is the listener registered for each worker message.

              @@ -564,11 +613,11 @@ Can be overridden

              Parameters

              +
              message: MessageValue<Response, unknown>

            Returns void

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

    Theme

    On This Page

    +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • max
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • numberOfQueuedTasks
  • +
  • numberOfRunningTasks
  • +
  • type
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • chooseWorkerNode
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • +
  • 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