X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=09fb7fa406096a103ebb639833008911509e28c6;hb=bf4dcb92f8d370524a2975961731fe6c4e8b083c;hp=0498d0bee1ab114b1f7a2e65b4390afd3d1f9943;hpb=0163b91de7e67e0c3b29b542bd2d47cce655b262;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 0498d0be..09fb7fa4 100644 --- a/docs/classes/FixedThreadPool.html +++ b/docs/classes/FixedThreadPool.html @@ -1,4 +1,4 @@ -FixedThreadPool | poolifier
+FixedThreadPool | poolifier
  • Preparing search index...
  • -
  • The search index is not available
poolifier
+
  • The search index is not available
  • 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,561 +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
    -
    -

    Inherit Doc

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

    Id of the next message.

    +
    filePath: string
    +

    Path to the worker file.

    -
    +
  • Defined in src/pools/abstract-pool.ts:78
  • +
    -
    numberOfWorkers: number
    -
    +
  • Defined in src/pools/abstract-pool.ts:77
  • +
    -
    -
    - -
    promiseMap: Map<number, PromiseWorkerResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    -

    The promise map.

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

    -
    - - -
    -

    Inherit Doc

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

    Inherit Doc

    +

    Inherited from AbstractPool.workerChoiceStrategyContext

    + +
    + +
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []
    +

    Pool worker nodes.

    +

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

      Inherit Doc

      +

      Number of tasks running in the pool.

      +

      Returns number

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

    -
    - -
    +
    -
      - +
        +
      • -
        -

        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/abstract-pool.ts:420
  • +
    -
    -
    +
  • Defined in src/pools/abstract-pool.ts:482
  • +
    -
    -
    +
  • Defined in src/pools/thread/fixed.ts:78
  • +
    -
      - +
    -
    - -
    -
    - -
    +
    + +
      +
    • -
      -

      Inherit Doc

      +

      Shutdowns the given worker.

      +

      Parameters

      • -
        data: Data
      -

      Returns Promise<Response>

    -
    - -
    -
    - -
    +

    Returns Promise<void>

    +
    + +
    -
    - - +

    Returns void

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

    Returns Promise<Response>

    Promise that will be fulfilled when the task is completed.

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

    Parameters

    Returns void

    Returns void

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

    Returns void

    -
    - -
    +
    + +

    Returns void

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

    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