X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=5338a29f2ff748c7d74194914b5949ec33b3a7eb;hb=fab6d3b5750d884b29e5e7057628a06d88d0df8a;hp=3d80e16254ca092efbd26def002b236ec569342f;hpb=e1230e386080ae19766e2a7863c807a90f13a3ef;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 3d80e162..5338a29f 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier
-
+
-
+

Type Parameters

-
    +
    • -

      Data = unknown

      +

      Data = unknown

      Type of data sent to the worker. This can only be serializable data.

    • -

      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

+
  • Defined in src/pools/thread/fixed.ts:29
  • @@ -52,550 +52,562 @@

    Constructors

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

        -
        +

        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

    -
    - -
    +
    + +
    -
    - - +

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

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

    Returns void

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

    + +
    +
    +
    +

    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