X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=f76448bb1447f1949c378be213edc3b6a37aaf6b;hb=fbc22127e53d3ec0ecbd38ecea25fb92ebef50e7;hp=e68d93c34e6ded0cfb012e67dcb8d9ed9446a639;hpb=842d8918a19fc2720d4436789a2e373bc623452e;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index e68d93c3..f76448bb 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier
-

Returns Promise<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
  • +
    -
    -
    - -
    +
    + +
      +
    • Registers a listener callback on the given worker.

      @@ -452,37 +461,37 @@ Can be overridden.

      Type Parameters

      • -

        Message

    +

    Message

    Parameters

    Returns void

    Returns void

    -
    +
  • Defined in src/pools/thread/fixed.ts:70
  • +
    -
    -
    +
  • Defined in src/pools/thread/fixed.ts:62
  • +
    + +
    +
    -
      - +
        +
      • Sets the worker choice strategy in this pool.

        @@ -512,17 +539,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
  • +
    + +
    +
    -
      - +
        +
      • Setup hook to execute code before worker node are created in the abstract constructor. Can be overridden

        @@ -530,21 +579,21 @@ Can be overridden

        Returns void

    -
    +
  • Defined in src/pools/abstract-pool.ts:360
  • +
    -
      - +
        +
      • 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.

              @@ -554,11 +603,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
  • +
  • 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