X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FFixedThreadPool.html;h=e0337f6da7d7ce5d90ae9a370f853298812aa781;hb=812ad701baefad24cad2df8f9a60bf4d581d8697;hp=1e6bea45b855b85a1fbb2c42fa893e1a4cbc46b2;hpb=bfed591d93e26b1e424e916abdb27c6f91dc9b45;p=poolifier.git diff --git a/docs/classes/FixedThreadPool.html b/docs/classes/FixedThreadPool.html index 1e6bea45..e0337f6d 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
    -
    +
    @@ -58,42 +58,35 @@

    Properties

    Accessors

    Methods

    -
    afterPromiseWorkerResponseHook +
    afterTaskExecutionHook afterWorkerSetup -beforePromiseWorkerResponseHook -chooseWorker +beforeTaskExecutionHook +chooseWorkerNode createAndSetupWorker createWorker destroy destroyWorker execute -findFreeWorker -getWorkerAverageTasksRunTime -getWorkerIndex -getWorkerRunningTasks -initWorkerTasksUsage -internalExecute -internalGetBusyStatus +findFreeWorkerNodeKey +internalBusy isMain registerWorkerMessageListener -removeWorker sendToWorker setWorkerChoiceStrategy setupHook @@ -104,7 +97,7 @@
    -

    Returns FixedThreadPool<Data, Response>

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

    @@ -143,79 +136,61 @@

    Inherit Doc

    +
  • Defined in src/pools/abstract-pool.ts:37
  • -
    filePath: string
    -
    - -
    max?: number
    -
    -

    Inherit Doc

    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

    +
    filePath: string
    +

    Path to the worker-file.

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

    The promise map.

    +
  • Defined in src/pools/abstract-pool.ts:73
  • +
    + +
    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:47
  • -
    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> = ...
    +
  • Defined in src/pools/abstract-pool.ts:57
  • +
    + +
    workerNodes: WorkerNode<ThreadWorkerWithMessageChannel, Data>[] = []

    Inherit Doc

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

    @@ -228,18 +203,40 @@

    Returns boolean

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

      Number of tasks queued in the pool.

      +
      +

      Returns number

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

      Number of tasks running in the pool.

      +

      Returns number

    +
  • Defined in src/pools/abstract-pool.ts:172
  • +
  • Defined in src/pools/thread/fixed.ts:95
  • Methods

    -
    - +
    +
      - +
    • -

      Hook executed after the worker task promise resolution. +

      Hook executed after the worker task execution. Can be overridden.

      Parameters

      Returns void

    +
  • Defined in src/pools/abstract-pool.ts:323
  • -
    - +
  • Defined in src/pools/thread/fixed.ts:85
  • +
    +
      - +
    • -

      Hook executed before the worker task promise resolution. +

      Hook executed before the worker task execution. Can be overridden.

      Parameters

      Returns void

    -
    - +
  • Defined in src/pools/abstract-pool.ts:312
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:356
  • +
  • Defined in src/pools/abstract-pool.ts:418
  • +
  • Defined in src/pools/thread/fixed.ts:78
  • +
  • Defined in src/pools/abstract-pool.ts:275
    • @@ -375,11 +372,11 @@ Can be overridden.

      Returns Promise<void>

    +
  • Defined in src/pools/thread/fixed.ts:54
    • - +
    • Inherit Doc

      @@ -387,113 +384,31 @@ Can be overridden.

      Parameters

      • -
        data: Data
    -

    Returns Promise<Response>

    +

    Returns Promise<Response>

    -
    - +
  • Defined in src/pools/abstract-pool.ts:244
  • +
    +
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:237
  • +
    +
      - +
    • Returns boolean

    +
  • Defined in src/pools/abstract-pool.ts:232
  • +
  • Defined in src/pools/thread/fixed.ts:49
    • - +
    • Inherit Doc

      @@ -523,44 +438,26 @@ Can be overridden.

    • messageChannel: ThreadWorkerWithMessageChannel
    • -
      listener: ((message: MessageValue<Message, unknown>) => void)
      +
      listener: ((message: MessageValue<Message, unknown>) => void)
        • -
        • (message: MessageValue<Message, unknown>): void
        • +
        • (message: MessageValue<Message, unknown>): void
        • Parameters

          • -
            message: MessageValue<Message, unknown>
          +
          message: MessageValue<Message, unknown>

    Returns void

    Returns void

    -
    - -
    +
  • Defined in src/pools/thread/fixed.ts:70
  • +
    message: MessageValue<Data, unknown>

    Returns void

    +
  • Defined in src/pools/thread/fixed.ts:62
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:205
  • +
  • Defined in src/pools/abstract-pool.ts:297
  • - +
    +
    -
    +
  • constructor
  • +
  • emitter
  • +
  • filePath
  • +
  • numberOfWorkers
  • +
  • opts
  • +
  • promiseResponseMap
  • +
  • workerChoiceStrategyContext
  • +
  • workerNodes
  • +
  • busy
  • +
  • full
  • +
  • numberOfQueuedTasks
  • +
  • numberOfRunningTasks
  • +
  • type
  • +
  • afterTaskExecutionHook
  • +
  • afterWorkerSetup
  • +
  • beforeTaskExecutionHook
  • +
  • chooseWorkerNode
  • +
  • createAndSetupWorker
  • +
  • createWorker
  • +
  • destroy
  • +
  • destroyWorker
  • +
  • execute
  • +
  • findFreeWorkerNodeKey
  • +
  • internalBusy
  • +
  • isMain
  • +
  • registerWorkerMessageListener
  • +
  • sendToWorker
  • +
  • setWorkerChoiceStrategy
  • +
  • setupHook
  • +
  • workerListener
  • + +

    Generated using TypeDoc

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