*/
export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
+/**
+ * Enumeration of measurements.
+ */
+export const Measurements = Object.freeze({
+ runTime: 'runTime',
+ waitTime: 'waitTime',
+ elu: 'elu'
+} as const)
+
+/**
+ * Measurement.
+ */
+export type Measurement = keyof typeof Measurements
+
/**
* Measurement options.
*/
-interface MeasurementOptions {
+export interface MeasurementOptions {
/**
* Set measurement median.
*/
* Worker choice strategy options.
*/
export interface WorkerChoiceStrategyOptions {
+ /**
+ * Measurement to use for worker choice strategy.
+ */
+ measurement?: Measurement
/**
* Runtime options.
*
*
* @internal
*/
-interface MeasurementStatisticsRequirements {
+export interface MeasurementStatisticsRequirements {
/**
* Require measurement aggregate.
*/
elu: MeasurementStatisticsRequirements
}
+/**
+ * Strategy policy.
+ *
+ * @internal
+ */
+export interface StrategyPolicy {
+ /**
+ * Expects direct usage of dynamic worker.
+ */
+ useDynamicWorker: boolean
+}
+
/**
* Worker choice strategy interface.
*/
export interface IWorkerChoiceStrategy {
+ /**
+ * Strategy policy.
+ */
+ readonly strategyPolicy: StrategyPolicy
/**
* Tasks statistics requirements.
*/