perf: use a single map to store pool workers and their related data
[poolifier.git] / src / pools / selection-strategies / selection-strategies-types.ts
index 499b8e489e744a3fad453391b8e4e664c90eac94..3e7c3427e84f7bedb015e8f6d7ef54215377bd40 100644 (file)
@@ -30,14 +30,14 @@ export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
 /**
  * Pool tasks usage statistics requirements.
  */
-export type RequiredStatistics = {
+export interface RequiredStatistics {
   runTime: boolean
 }
 
 /**
  * Worker choice strategy interface.
  *
- * @template Worker Type of worker which manages the strategy.
+ * @typeParam Worker - Type of worker which manages the strategy.
  */
 export interface IWorkerChoiceStrategy<Worker extends IPoolWorker> {
   /**
@@ -51,9 +51,9 @@ export interface IWorkerChoiceStrategy<Worker extends IPoolWorker> {
   /**
    * Resets strategy internals (counters, statistics, etc.).
    */
-  reset(): boolean
+  reset: () => boolean
   /**
    * Chooses a worker in the pool.
    */
-  choose(): Worker
+  choose: () => Worker
 }