X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=f76448bb1447f1949c378be213edc3b6a37aaf6b;hb=fbc22127e53d3ec0ecbd38ecea25fb92ebef50e7;hp=f8b60f70a449479799b5bac6af867143bd0926c9;hpb=cfc6e8df4c903b63514c46cb67b3f5e24079d3ce;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index f8b60f70..f76448bb 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,56 +52,54 @@

    Constructors

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

        @@ -109,477 +107,495 @@

        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
    -

    {@inheritDoc}

    -
    -
    - -
    filePath: string
    -

    Path to the worker-file.

    +
  • 'full': Emitted when the pool is dynamic and full.
  • +
  • 'busy': Emitted when the pool is busy.
  • +
    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

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

    -
    - -
    promiseMap: Map<number, PromiseWorkerResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    -

    The promise map.

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

    The execution response promise map.

      -
    • key: This is the message Id of each submitted task.
    • -
    • value: An object that contains the worker, the resolve function and the reject function.
    • +
    • key: The message id of each submitted task.
    • +
    • value: An object that contains the worker, the execution response promise resolve and reject callbacks.
    -

    When we receive a message from the worker we get a map entry and resolve/reject the promise based on the message.

    +

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

    Worker choice strategy instance implementing the worker choice algorithm.

    -

    Default to a strategy implementing a round robin algorithm.

    +
    workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>
    +

    Worker choice strategy context referencing a worker choice algorithm implementation.

    +

    Default to a round robin algorithm.

    -
    - - -

    {@inheritDoc}

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

    Pool worker nodes.

    -
    - -
    workersTasksUsage: Map<ThreadWorkerWithMessageChannel, TasksUsage> = ...
    -

    {@inheritDoc}

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

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

      Whether the pool is full or not.

      +

      The pool filling boolean status.

      +
      +

      Returns boolean

    +
    + +
      +
    • get numberOfQueuedTasks(): number
    • +
    • +

      Number of tasks queued in the pool.

      +
      +

      Returns number

    +
    + +
    • get numberOfRunningTasks(): number
    • -

      {@inheritDoc}

      +

      Number of tasks running in the pool.

      Returns number

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

    -
    - -
    +
    -

    Returns void

    -
    - -
    +
    + +
    -
    - -
    +
    + +
    -
    +
  • Defined in src/pools/abstract-pool.ts:419
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:481
  • +
    -
    -
    +
  • Defined in src/pools/thread/fixed.ts:78
  • +
    -
      - +
        +
      • -

        {@inheritDoc}

        +

        Shutdowns every current worker in this pool.

        -

        Returns Promise<void>

    -
    - -
    +
    + +
    -
    - -
      - -
    • -

      {@inheritDoc}

      -
      -
      -

      Parameters

      -
        -
      • -
        data: Data
      -

      Returns Promise<Response>

    -
    - -
    -
    - -
    +

    Returns Promise<void>

    +
    + +
      +
    • -

      {@inheritDoc}

      +

      Enables/disables the worker tasks queue in this pool.

      Parameters

      -

      Returns undefined | number

    -
    - -
    +

    Returns void

    -
    - -
    +
    + +
      +
    • -

      {@inheritDoc}

      +

      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

      -

      Returns undefined | number

    -
    - -
      - +
      Optional data: Data
      +

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

      +
    +

    Returns Promise<Response>

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

    Parameters

    Returns void

    Returns void

    -
    - -
    +
    + +
    -
    - -
    +
    + +

    Returns void

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

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

    Generated using TypeDoc

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