X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=357fe5d09f1c8bdf75a698044475f0895602248e;hb=3bd6a82e43e11294af91bbd19647944ac740169e;hp=b0447260169ffc39b243e3fa2c43855c988917eb;hpb=f9a95a93439b96a3ba1262ef807e1ba39b65bca4;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index b0447260..357fe5d0 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier
-
+
+
  • Defined in src/pools/thread/fixed.ts:29
  • @@ -52,52 +52,55 @@

    Constructors

    -
    +
    -
      - +
        +
      • Constructs a new poolifier fixed thread pool.

        @@ -105,65 +108,70 @@

        Type Parameters

        • -

          Data = unknown

        • +

          Data = unknown

        • -

          Response = unknown

    +

    Response = unknown

    Parameters

    -

    Returns FixedThreadPool<Data, Response>

    +
  • Defined in src/pools/thread/fixed.ts:40
  • Properties

    -
    +
    -
    emitter?: PoolEmitter
    -
    -

    Inherit Doc

    -
    +
  • 'full': Emitted when the pool is dynamic and full.
  • +
  • 'busy': Emitted when the pool is busy.
  • + +
    +
    -
    filePath: string
    -

    Path to the worker-file.

    +
    filePath: string
    +

    Path to the worker file.

    -
    +
  • Defined in src/pools/abstract-pool.ts:77
  • +
    -
    numberOfWorkers: number
    +
    numberOfWorkers: number

    Number of workers that this pool should manage.

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

    Options for the pool.

    -
    +
  • Defined in src/pools/abstract-pool.ts:78
  • +
    -
    promiseResponseMap: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    +
    promiseResponseMap: Map<string, PromiseResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...

    The execution response promise map.

    • key: The message id of each submitted task.
    • @@ -171,53 +179,55 @@

    When we receive a message from the worker, we get a map entry with the promise resolve/reject bound to the message id.

    -
    +
  • Defined in src/pools/abstract-pool.ts:52
  • +
    -
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>
    +
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>

    Worker choice strategy context referencing a worker choice algorithm implementation.

    Default to a round robin algorithm.

    -
    +
  • Defined in src/pools/abstract-pool.ts:62
  • +
    -
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
    -
    -

    Inherit Doc

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

    -
    - -
    +
    + +
    • get full(): boolean
    • -
      -

      Inherit Doc

      +

      Whether the pool is full or not.

      +

      The pool filling boolean status.

      +

      Returns boolean

    -
    +
  • Defined in src/pools/thread/fixed.ts:100
  • +
    -
      +
      • get numberOfQueuedTasks(): number
      • Number of tasks queued in the pool.

        @@ -225,10 +235,10 @@

        Returns number

    -
    +
  • Defined in src/pools/abstract-pool.ts:195
  • +
    -
      +
      • get numberOfRunningTasks(): number
      • Number of tasks running in the pool.

        @@ -236,24 +246,25 @@

        Returns number

    -
    +
  • Defined in src/pools/abstract-pool.ts:185
  • +
    -
      -
    • get type(): PoolType
    • +
    +
  • Defined in src/pools/thread/fixed.ts:95
  • Methods

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

        Inherit Doc

        +

        Function that can be hooked up when a worker has been newly created and moved to the pool worker nodes.

        +

        Can be used to update the maxListeners or binding the main-worker<->worker connection if not bind by default.

        +

        Parameters

        +
        worker: ThreadWorkerWithMessageChannel
        +

        The newly created worker.

        +

    Returns void

    -
    +
  • Defined in src/pools/thread/fixed.ts:85
  • +
    -
      - +
        +
      • Hook executed before the worker task execution. Can be overridden.

        @@ -301,219 +315,301 @@ Can be overridden.

        Parameters

        • -
          workerNodeKey: number
          +
          workerNodeKey: number

          The worker node key.

        Returns void

    -
    +
  • Defined in src/pools/abstract-pool.ts:378
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:422
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:484
  • +
    -
    -
    +
  • Defined in src/pools/thread/fixed.ts:78
  • +
    -
      - +
    -
    - -
    +
    + +
    +

    Returns Promise<void>

    +
    + +
      + +
    • +

      Enables/disables the worker tasks queue in this pool.

      +
      +
      +

      Parameters

      +
        +
      • +
        enable: boolean
        +

        Whether to enable or disable the worker tasks queue.

        +
      • +
      • +
        Optional tasksQueueOptions: TasksQueueOptions
        +

        The worker tasks queue options.

        +
      +

      Returns void

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

        Inherit Doc

        +

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

        + +

        Returns

        Promise that will be fulfilled when the task is completed.

        +

        Parameters

        • -
          data: Data
        -

        Returns Promise<Response>

    +

    Returns Promise<Response>

    -
    +
  • Defined in src/pools/abstract-pool.ts:310
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:303
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:298
  • +
    -
    -
    - -
    +
    + +

    Parameters

    Returns void

    Returns void

    -
    +
  • Defined in src/pools/thread/fixed.ts:70
  • +
    -
    +
    + +

    Returns void

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

    Returns void

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

    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
  • +
  • findFreeWorkerNodeKey
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendToWorker
  • +
  • setTasksQueueOptions
  • +
  • setWorkerChoiceStrategy
  • +
  • setWorkerChoiceStrategyOptions
  • +
  • setupHook
  • +
  • workerListener
  • + +

    Generated using TypeDoc

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