X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FDynamicThreadPool.html;h=07859038567bc8e48b70383718db21874811f673;hb=b4d61a7596f314145be453ddbcaa9b0dade39bfb;hp=986df6156e33bd2478a2ae0216927dd37ba0f4dc;hpb=f1583b4edd427f8c3f2b4ddc652d2e102390b08e;p=poolifier.git diff --git a/docs/classes/DynamicThreadPool.html b/docs/classes/DynamicThreadPool.html index 986df615..07859038 100644 --- a/docs/classes/DynamicThreadPool.html +++ b/docs/classes/DynamicThreadPool.html @@ -1,11 +1,13 @@ DynamicThreadPool | poolifier
-
+
@@ -18,10 +20,6 @@

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.

-

Template

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

- -

Template

of response of execution. This can only be serializable data.

-

Author

Alessandro Pio Ardizio

Since

0.0.1

@@ -30,9 +28,13 @@ When the maximum number of threads is reached, an event is emitted. If you want

Type Parameters

  • -

    Data = unknown

  • +

    Data = unknown

    +

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

    +
  • -

    Response = unknown

+

Response = unknown

+

Type of response of execution. This can only be serializable data.

+

Hierarchy

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

    Properties

    Accessors

    @@ -71,21 +71,16 @@ When the maximum number of threads is reached, an event is emitted. If you want

    Methods

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

    -
    emitter?: PoolEmitter
    -
    -

    Inherit Doc

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

    Inherit Doc

    -
    - -
    nextMessageId: number = 0
    -

    Id of the next message.

    +

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

    +
  • Defined in src/pools/thread/dynamic.ts:31
  • -
    numberOfWorkers: number
    +
  • Defined in src/pools/abstract-pool.ts:66
  • -
    -
    - -
    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.

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

    +
  • Defined in src/pools/abstract-pool.ts:42
  • workerChoiceStrategyContext: WorkerChoiceStrategyContext<ThreadWorkerWithMessageChannel, Data, Response>
    @@ -199,23 +191,15 @@ When the maximum number of threads is reached, an event is emitted. If you want
    +
  • Defined in src/pools/abstract-pool.ts:52
  • - -
    -

    Inherit Doc

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

    Inherit Doc

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

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

    -
    - +
    +
    +
  • Defined in src/pools/abstract-pool.ts:252
  • -
    - +
  • Defined in src/pools/thread/fixed.ts:85
  • +
    +
    +
  • Defined in src/pools/abstract-pool.ts:241
  • +
  • Defined in src/pools/abstract-pool.ts:289
  • +
  • Defined in src/pools/abstract-pool.ts:334
  • +
  • Defined in src/pools/thread/fixed.ts:78
  • +
  • Defined in src/pools/abstract-pool.ts:207
  • +
  • Defined in src/pools/thread/fixed.ts:54
  • -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    - +
  • Defined in src/pools/abstract-pool.ts:192
  • +
    +
    -
    - -
    +
  • Defined in src/pools/abstract-pool.ts:185
  • +
  • Defined in src/pools/abstract-pool.ts:177
  • +
  • Defined in src/pools/thread/fixed.ts:49
  • +
  • Defined in src/pools/abstract-pool.ts:276
  • +
  • Defined in src/pools/thread/fixed.ts:62
  • Returns void

    +
  • Defined in src/pools/abstract-pool.ts:156
  • +
  • Defined in src/pools/abstract-pool.ts:226
  • +
  • Defined in src/pools/abstract-pool.ts:363