Merge branch 'master' into elu-strategy
[poolifier.git] / src / pools / selection-strategies / selection-strategies-types.ts
index c90036fe6f269dd7757482064a3fdba0b7a97e97..b96bb029a0befe39ce438beb368e2c0dbecb87ab 100644 (file)
@@ -14,6 +14,12 @@ export const WorkerChoiceStrategies = Object.freeze({
    * Least busy worker selection strategy.
    */
   LEAST_BUSY: 'LEAST_BUSY',
+  /**
+   * Least ELU worker selection strategy.
+   *
+   * @experimental
+   */
+  LEAST_ELU: 'LEAST_ELU',
   /**
    * Fair share worker selection strategy.
    */
@@ -21,7 +27,13 @@ export const WorkerChoiceStrategies = Object.freeze({
   /**
    * Weighted round robin worker selection strategy.
    */
-  WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN'
+  WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN',
+  /**
+   * Interleaved weighted round robin worker selection strategy.
+   *
+   * @experimental
+   */
+  INTERLEAVED_WEIGHTED_ROUND_ROBIN: 'INTERLEAVED_WEIGHTED_ROUND_ROBIN'
 } as const)
 
 /**
@@ -59,7 +71,7 @@ export interface WorkerChoiceStrategyOptions {
  *
  * @internal
  */
-export interface RequiredStatistics {
+export interface TaskStatistics {
   /**
    * Require tasks runtime.
    */
@@ -84,6 +96,10 @@ export interface RequiredStatistics {
    * Require tasks median wait time.
    */
   medWaitTime: boolean
+  /**
+   * Event loop utilization.
+   */
+  elu: boolean
 }
 
 /**
@@ -91,9 +107,9 @@ export interface RequiredStatistics {
  */
 export interface IWorkerChoiceStrategy {
   /**
-   * Required tasks usage statistics.
+   * Required tasks statistics.
    */
-  readonly requiredStatistics: RequiredStatistics
+  readonly taskStatistics: TaskStatistics
   /**
    * Resets strategy internals.
    *