X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=docs%2Fclasses%2FAbstractPool.html;h=4ffefe2c7609adaa617347ad5dbaf5c0079bc89d;hb=b22361f4474e4a63a7482741d98f0c58b4b03b4c;hp=e382e9e16e85fa1b4736e8df9cfd0842e9c02057;hpb=f4d1dbd1592e24d7a09f35013c3e0f0762240254;p=poolifier.git diff --git a/docs/classes/AbstractPool.html b/docs/classes/AbstractPool.html index e382e9e1..4ffefe2c 100644 --- a/docs/classes/AbstractPool.html +++ b/docs/classes/AbstractPool.html @@ -1,67 +1,9 @@ -AbstractPool | poolifier - v2.6.45
-
- -
-
-
-
- -

Class AbstractPool<Worker, Data, Response>Abstract

-
-

Base class that implements some shared logic for all poolifier pools.

-
-
-
-

Type Parameters

-
    -
  • -

    Worker extends IWorker

    -

    Type of worker which manages this pool.

    -
    -
  • -
  • -

    Data = unknown

    -

    Type of data sent to the worker. This can only be structured-cloneable data.

    -
    -
  • -
  • -

    Response = unknown

    -

    Type of execution response. This can only be structured-cloneable data.

    -
    -
-
-

Hierarchy

-
-
-

Implements

-
    -
  • IPool<Worker, Data, Response>
-
-
-
- -
-
-

Constructors

-
-
-

Properties

-
emitter? +AbstractPool | poolifier - v3.0.5

Class AbstractPool<Worker, Data, Response>Abstract

Base class that implements some shared logic for all poolifier pools.

+

Type Parameters

  • Worker extends IWorker

    Type of worker which manages this pool.

    +
  • Data = unknown

    Type of data sent to the worker. This can only be structured-cloneable data.

    +
  • Response = unknown

    Type of execution response. This can only be structured-cloneable data.

    +

Hierarchy

Implements

  • IPool<Worker, Data, Response>

Constructors

Properties

-
-

Accessors

-

Accessors

busy full info maxSize @@ -84,10 +24,8 @@ type utilization worker -
-
-

Methods

-

Methods

addTaskFunction +addWorkerNode afterTaskExecutionHook afterWorkerNodeSetup beforeTaskExecutionHook @@ -95,44 +33,52 @@ checkAndEmitDynamicWorkerCreationEvents checkAndEmitTaskExecutionEvents checkAndEmitTaskQueuingEvents -checkDynamicPoolSize -checkFilePath checkMessageWorkerId checkNumberOfWorkers checkPoolOptions -checkValidTasksQueueOptions -checkValidWorkerChoiceStrategy checkValidWorkerChoiceStrategyOptions chooseWorkerNode createAndSetupDynamicWorkerNode createAndSetupWorkerNode createWorker +deleteTaskFunctionWorkerUsages dequeueTask +deregisterWorkerMessageListener destroy destroyWorkerNode enableTasksQueue enqueueTask execute executeTask +flagWorkerNodeAsNotReady flushTasksQueue flushTasksQueues getWorkerInfo getWorkerNodeKeyByWorker getWorkerNodeKeyByWorkerId +handleBackPressureEvent +handleEmptyQueueEvent handleTaskExecutionResponse handleWorkerReadyResponse hasBackPressure +hasTaskFunction hasWorkerNodeBackPressure +initializeEventEmitter internalBusy isMain -listTaskFunctions +listTaskFunctionNames redistributeQueuedTasks +registerOnceWorkerMessageListener registerWorkerMessageListener +removeTaskFunction removeWorkerNode sendKillMessageToWorker sendStartupMessageToWorker sendStatisticsMessageToWorker +sendTaskFunctionOperationToWorker +sendTaskFunctionOperationToWorkers sendToWorker +setDefaultTaskFunction setTaskStealing setTasksQueueOptions setTasksQueueSize @@ -144,9 +90,7 @@ shallExecuteTask shallUpdateTaskFunctionWorkerUsage start -taskStealingOnEmptyQueue tasksQueueSize -tasksStealingOnBackPressure unsetTaskStealing unsetTasksStealingOnBackPressure updateEluWorkerUsage @@ -154,54 +98,13 @@ updateTaskStatisticsWorkerUsage updateTaskStolenStatisticsWorkerUsage updateWaitTimeWorkerUsage -workerListener -
-
-

Constructors

-
- -
    - -
  • -

    Constructs a new poolifier pool.

    -
    -
    -

    Type Parameters

    -
      -
    • -

      Worker extends IWorker

    • -
    • -

      Data = unknown

    • -
    • -

      Response = unknown

    -
    -

    Parameters

    -
      -
    • -
      numberOfWorkers: number
      -

      Number of workers that this pool should manage.

      -
      -
    • -
    • -
      filePath: string
      -

      Path to the worker file.

      -
      -
    • -
    • -
      opts: PoolOptions<Worker>
      -

      Options for the pool.

      -
      -
    -

    Returns AbstractPool<Worker, Data, Response>

    -
-
-

Properties

-
- -
emitter?: PoolEmitter
-

Emitter on which events can be listened to.

+workerMessageListener +

Constructors

  • Constructs a new poolifier pool.

    +

    Type Parameters

    • Worker extends IWorker

    • Data = unknown

    • Response = unknown

    Parameters

    • numberOfWorkers: number

      Number of workers that this pool should manage.

      +
    • filePath: string

      Path to the worker file.

      +
    • opts: PoolOptions<Worker>

      Options for the pool.

      +

    Returns AbstractPool<Worker, Data, Response>

Properties

emitter?: EventEmitterAsyncResource

Event emitter integrated with async resource on which events can be listened to. +The async tracking tooling identifier is poolifier:<PoolType>-<WorkerType>-pool.

Events that can currently be listened to:

  • 'ready': Emitted when the number of workers created in the pool has reached the minimum size expected and are ready.
  • @@ -212,1415 +115,146 @@
  • 'taskError': Emitted when an error occurs while executing a task.
  • 'backPressure': Emitted when all worker nodes have back pressure (i.e. their tasks queue is full: queue size >= maximum queue size).
-
-
-
- -
filePath: string
-

Path to the worker file.

-
-
-
- -
max?: number
-

Dynamic pool maximum size property placeholder.

-
-
-
- -
numberOfWorkers: number
-

Number of workers that this pool should manage.

-
-
-
- -
opts: PoolOptions<Worker>
-

Options for the pool.

-
-
-
- -
promiseResponseMap: Map<string, PromiseResponseWrapper<Response>> = ...
-

The task execution response promise map:

+
filePath: string

Path to the worker file.

+
max?: number

Dynamic pool maximum size property placeholder.

+
numberOfWorkers: number

Number of workers that this pool should manage.

+
opts: PoolOptions<Worker>

Options for the pool.

+
promiseResponseMap: Map<string, PromiseResponseWrapper<Response>> = ...

The task execution response promise map:

  • 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 with the promise resolve/reject bound to the message id.

-
-
-
- -
startTimestamp: number
-

The start timestamp of the pool.

-
-
-
- -
started: boolean
-

Whether the pool is started or not.

-
-
-
- -
starting: boolean
-

Whether the pool is starting or not.

-
-
-
- -
workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>
-

Worker choice strategy context referencing a worker choice algorithm implementation.

-
-
-
- -
workerNodes: IWorkerNode<Worker, Data>[] = []
-

Pool worker nodes.

-
-
startTimestamp: number

The start timestamp of the pool.

+
started: boolean

Whether the pool is started or not.

+
starting: boolean

Whether the pool is starting or not.

+
taskFunctions: Map<string, TaskFunction<Data, Response>>

The task functions added at runtime map:

-
-

Accessors

-
- -
    -
  • get busy(): boolean
  • -
  • -

    Whether the pool is busy or not.

    +
  • key: The task function name.
  • +
  • value: The task function itself.
  • +
+
workerChoiceStrategyContext: WorkerChoiceStrategyContext<Worker, Data, Response>

Worker choice strategy context referencing a worker choice algorithm implementation.

+
workerNodes: IWorkerNode<Worker, Data>[] = []

Pool worker nodes.

+

Accessors

-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-

Methods

-
- -
-
- -

Methods

-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-

Generated using TypeDoc

-
\ No newline at end of file +

Returns void

Generated using TypeDoc

\ No newline at end of file