X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Finterfaces%2FIPool.html;h=740e3b8eb00235c2d5f748a35952d59f3e1aafe5;hb=71056a0ac555e096c1428d6341ef45c7980a6332;hp=a365532216bb8e1ff0dd64294b0e1c5c5dced6d8;hpb=a76fac14098cf2138cf8d6997ac7c89d8c3ae508;p=poolifier.git diff --git a/docs/interfaces/IPool.html b/docs/interfaces/IPool.html index a3655322..740e3b8e 100644 --- a/docs/interfaces/IPool.html +++ b/docs/interfaces/IPool.html @@ -1,101 +1,259 @@ -IPool | poolifier
+IPool | poolifier
-
+
-
+
-

Interface IPool<Data, Response>

+

Interface IPool<Worker, Data, Response>

Contract definition for a poolifier pool.

-
-
+
+
+

Type Parameters

-
+
  • -

    Response = unknown

    -

    Type of response of execution. This can only be serializable data.

    -
  • +

    Response = unknown

    +

    Type of execution response. This can only be serializable data.

    +
    +

    Hierarchy

    -

    Methods

    -
    - -
    -
    - -
    +
    + +
    execute: ((data?, name?) => Promise<Response>)
    +
    +

    Type declaration

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

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

        +

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

        +
        +
        +

        Parameters

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

        Promise that will be fulfilled when the task is completed.

        -

        Returns

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

        +
    +
    + +
    info: PoolInfo
    +

    Pool information.

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

    Type declaration

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

        Sets the worker tasks queue options in this pool.

        Parameters

        • -
          data: Data
          -

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

          -
        -

        Returns Promise<Response>

    +

    Returns void

    +
    -
    - -
    +
    + +
    setWorkerChoiceStrategy: ((workerChoiceStrategy, workerChoiceStrategyOptions?) => void)
    +
    +

    Type declaration

    +
      +
    • +
        +
      • (workerChoiceStrategy, workerChoiceStrategyOptions?): void
      • -

        Set the worker choice strategy in this pool.

        +

        Sets the worker choice strategy in this pool.

        Parameters

        • -
          workerChoiceStrategy: "ROUND_ROBIN" | "LESS_RECENTLY_USED"
          +
          workerChoiceStrategy: "ROUND_ROBIN" | "LEAST_USED" | "LEAST_BUSY" | "FAIR_SHARE" | "WEIGHTED_ROUND_ROBIN" | "INTERLEAVED_WEIGHTED_ROUND_ROBIN"

          The worker choice strategy.

          -
        -

        Returns void

        +
      • +
      • +
        Optional workerChoiceStrategyOptions: WorkerChoiceStrategyOptions
        +

        The worker choice strategy options.

        +
        +
    +

    Returns void

    +
    - +
    +
    +
    +

    On This Page

    - -
    +
  • destroy
  • +
  • emitter
  • +
  • enableTasksQueue
  • +
  • execute
  • +
  • info
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • workerNodes
  • + +

    Generated using TypeDoc

    -
    \ No newline at end of file +
    \ No newline at end of file