X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=e00359ef25599e5a990548d5d98ce960aa0d9b24;hb=94ab998f44abe7ed2184a0702c45621b06f5641f;hp=2e15a586eea7531ad9c62f6f445920ffe912beb7;hpb=2a7995b1242609d257b82b043ee772ee49f5c7ec;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 2e15a586..e00359ef 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -18,7 +18,7 @@

A thread pool with a dynamic number of threads, but a guaranteed minimum number of threads.

This thread pool creates new threads when the others are busy, up to the maximum number of threads. -When the maximum number of threads is reached, an event is emitted. If you want to listen to this event, use the pool's emitter.

+When the maximum number of threads is reached and workers are busy, an event is emitted. If you want to listen to this event, use the pool's emitter.

Author

Alessandro Pio Ardizio

@@ -42,7 +42,7 @@ When the maximum number of threads is reached, an event is emitted. If you want
+
  • Defined in src/pools/thread/dynamic.ts:17
  • @@ -56,37 +56,33 @@ When the maximum number of threads is reached, an event is emitted. If you want

    Properties

    Accessors

    Methods

    -
    +
  • Defined in src/pools/thread/dynamic.ts:29
  • Properties

    emitter?: PoolEmitter
    -

    {@inheritDoc}

    -
    +
  • Defined in src/pools/abstract-pool.ts:32
  • filePath: string
    @@ -151,22 +147,14 @@ When the maximum number of threads is reached, an event is emitted. If you want
    -
    - +
  • Defined in src/pools/abstract-pool.ts:67
  • +
    +
    max: number

    Maximum number of threads that can be created by this pool.

    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

    -
    +
  • Defined in src/pools/thread/dynamic.ts:31
  • numberOfWorkers: number
    @@ -174,7 +162,7 @@ When the maximum number of threads is reached, an event is emitted. If you want
    +
  • Defined in src/pools/abstract-pool.ts:66
  • opts: PoolOptions<ThreadWorkerWithMessageChannel>
    @@ -182,45 +170,37 @@ When the maximum number of threads is reached, an event is emitted. If you want
    -
    - -
    promiseMap: Map<number, PromiseWorkerResponseWrapper<ThreadWorkerWithMessageChannel, Response>> = ...
    -

    The promise map.

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

    The promise response map.

    -

    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.

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

    Worker choice strategy instance implementing the worker choice algorithm.

    -

    Default to a strategy implementing a round robin algorithm.

    +

    Worker choice strategy context referencing a worker choice algorithm implementation.

    +

    Default to a round robin algorithm.

    +
  • Defined in src/pools/abstract-pool.ts:52
  • -
    workers: ThreadWorkerWithMessageChannel[] = []
    -

    {@inheritDoc}

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

    {@inheritDoc}

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

    @@ -228,40 +208,51 @@ When the maximum number of threads is reached, an event is emitted. If you want
    -
    - -
    +
    + +
    +
    + +
    +
  • Defined in src/pools/abstract-pool.ts:149
  • +
  • Defined in src/pools/thread/dynamic.ts:39
  • Methods

    -
    - +
    +
    +
  • Defined in src/pools/abstract-pool.ts:268
  • -
    - +
  • Defined in src/pools/thread/fixed.ts:85
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:257
  • +
  • Defined in src/pools/abstract-pool.ts:297
  • +
  • Defined in src/pools/abstract-pool.ts:363
  • +
  • Defined in src/pools/thread/fixed.ts:78
  • +
  • Defined in src/pools/abstract-pool.ts:220
  • +
  • Defined in src/pools/thread/fixed.ts:54
  • -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:204
  • +
    +
    -
    - -
    -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:197
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:189
  • +
  • Defined in src/pools/thread/fixed.ts:49
  • +
  • Defined in src/pools/abstract-pool.ts:487
  • +
  • Defined in src/pools/thread/fixed.ts:62
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:164
  • +
  • Defined in src/pools/abstract-pool.ts:242
  • +
  • Defined in src/pools/abstract-pool.ts:392