+interface MeasurementStatisticsRequirements {
+ /**
+ * Require measurement aggregate.
+ */
+ aggregate: boolean
+ /**
+ * Require measurement average.
+ */
+ average: boolean
+ /**
+ * Require measurement median.
+ */
+ median: boolean
+}
+
+/**
+ * Pool worker node worker usage statistics requirements.
+ *
+ * @internal
+ */
+export interface TaskStatisticsRequirements {
+ /**
+ * Tasks runtime requirements.
+ */
+ runTime: MeasurementStatisticsRequirements
+ /**
+ * Tasks wait time requirements.
+ */
+ waitTime: MeasurementStatisticsRequirements
+ /**
+ * Tasks event loop utilization requirements.
+ */
+ elu: MeasurementStatisticsRequirements
+}
+
+/**
+ * Worker choice strategy interface.
+ */
+export interface IWorkerChoiceStrategy {
+ /**
+ * Tasks statistics requirements.
+ */
+ readonly taskStatisticsRequirements: TaskStatisticsRequirements
+ /**
+ * Resets strategy internals.
+ *
+ * @returns `true` if the reset is successful, `false` otherwise.
+ */
+ reset: () => boolean
+ /**
+ * Updates the worker node key strategy internals.
+ *
+ * @returns `true` if the update is successful, `false` otherwise.
+ */
+ update: (workerNodeKey: number) => boolean
+ /**
+ * Chooses a worker node in the pool and returns its key.
+ *
+ * @returns The worker node key.
+ */
+ choose: () => number