@nsshunt/stsrunnerframework 1.0.95 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _collectorCollectorPort, _runners, _options, _workerId, _logMessage, _debug, _error, _warn, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _logMessage2, _debug2, _error2, _processLoopExecutor2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers,
|
|
12
|
+
var _collectorCollectorPort, _runners, _options, _workerId, _logMessage, _debug, _error, _warn, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _PostRunnersToWorkerManager, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _messages, _logMessage2, _debug2, _error2, _processLoopExecutor2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitWorkerEvent, _EmitRunnerEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _BroadcastCommandToAllRunners, _HandleAllWorkers, _ExecuteCommandOnRunners, _STSWorkerManager_instances, GetRunnersResponse_fn, _SyncRunnerData, _SyncWorkerDataFromPayload, _SyncWorkerDataFromWorker, _SyncWorkerDataFromWorkers, _PostMessageToWorkerGetRunners;
|
|
13
13
|
import { defaultLogger, Sleep, ModelDelimeter } from "@nsshunt/stsutils";
|
|
14
14
|
import { Gauge } from "@nsshunt/stsobservability";
|
|
15
15
|
const URI_BASE_VUEUTILS = "/";
|
|
@@ -2791,8 +2791,8 @@ class STSWorkerManager {
|
|
|
2791
2791
|
return busyWorker;
|
|
2792
2792
|
});
|
|
2793
2793
|
// IExecuteRunnerActionResult[]
|
|
2794
|
-
__privateAdd(this, _HandleAllWorkers, (action, options) => {
|
|
2795
|
-
const retVal = Object.values(this.WorkersEx).map((worker) => {
|
|
2794
|
+
__privateAdd(this, _HandleAllWorkers, (workerIds, action, options) => {
|
|
2795
|
+
const retVal = Object.values(this.WorkersEx).filter((workerEx) => workerIds.length === 0 ? true : workerIds.includes(workerEx.id)).map((worker) => {
|
|
2796
2796
|
if (action === "UpdateOptions") {
|
|
2797
2797
|
return {
|
|
2798
2798
|
workerManagerId: __privateGet(this, _id),
|
|
@@ -2809,149 +2809,77 @@ class STSWorkerManager {
|
|
|
2809
2809
|
});
|
|
2810
2810
|
return retVal;
|
|
2811
2811
|
});
|
|
2812
|
-
__publicField(this, "StartAllWorkers", () => {
|
|
2813
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Start");
|
|
2812
|
+
__publicField(this, "StartAllWorkers", (workerIds) => {
|
|
2813
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Start");
|
|
2814
2814
|
});
|
|
2815
|
-
__publicField(this, "StopAllWorkers", () => {
|
|
2816
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Stop");
|
|
2815
|
+
__publicField(this, "StopAllWorkers", (workerIds) => {
|
|
2816
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Stop");
|
|
2817
2817
|
});
|
|
2818
|
-
__publicField(this, "PauseAllWorkers", () => {
|
|
2819
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Pause");
|
|
2818
|
+
__publicField(this, "PauseAllWorkers", (workerIds) => {
|
|
2819
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Pause");
|
|
2820
2820
|
});
|
|
2821
|
-
__publicField(this, "ResumeAllWorkers", () => {
|
|
2822
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Resume");
|
|
2821
|
+
__publicField(this, "ResumeAllWorkers", (workerIds) => {
|
|
2822
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Resume");
|
|
2823
2823
|
});
|
|
2824
|
-
__publicField(this, "ExecuteAllWorkers", () => {
|
|
2825
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Execute");
|
|
2824
|
+
__publicField(this, "ExecuteAllWorkers", (workerIds) => {
|
|
2825
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Execute");
|
|
2826
2826
|
});
|
|
2827
|
-
__publicField(this, "ResetAllWorkers", () => {
|
|
2828
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Reset");
|
|
2827
|
+
__publicField(this, "ResetAllWorkers", (workerIds) => {
|
|
2828
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Reset");
|
|
2829
2829
|
});
|
|
2830
|
-
__publicField(this, "TerminateAllWorkers", () => {
|
|
2831
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "Terminate");
|
|
2830
|
+
__publicField(this, "TerminateAllWorkers", (workerIds) => {
|
|
2831
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "Terminate");
|
|
2832
2832
|
});
|
|
2833
|
-
__publicField(this, "UpdateAllWorkers", (options) => {
|
|
2834
|
-
return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
|
|
2833
|
+
__publicField(this, "UpdateAllWorkers", (workerIds, options) => {
|
|
2834
|
+
return __privateGet(this, _HandleAllWorkers).call(this, workerIds, "UpdateOptions", options);
|
|
2835
2835
|
});
|
|
2836
|
-
|
|
2836
|
+
__privateAdd(this, _ExecuteCommandOnRunners, (workerId, runnerIds, command, executionProfile) => {
|
|
2837
2837
|
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
__publicField(this, "StartRunner", (workerId, runnerId) => {
|
|
2857
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2858
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2859
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Start();
|
|
2860
|
-
}
|
|
2861
|
-
}
|
|
2862
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2863
|
-
});
|
|
2864
|
-
__publicField(this, "PauseAllRunners", (workerId) => {
|
|
2865
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2866
|
-
return __privateGet(this, _workersEx)[workerId].Pause();
|
|
2867
|
-
}
|
|
2868
|
-
return [];
|
|
2869
|
-
});
|
|
2870
|
-
__publicField(this, "PauseRunner", (workerId, runnerId) => {
|
|
2871
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2872
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2873
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Pause();
|
|
2874
|
-
}
|
|
2875
|
-
}
|
|
2876
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2877
|
-
});
|
|
2878
|
-
__publicField(this, "ResumeAllRunners", (workerId) => {
|
|
2879
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2880
|
-
return __privateGet(this, _workersEx)[workerId].Resume();
|
|
2881
|
-
}
|
|
2882
|
-
return [];
|
|
2883
|
-
});
|
|
2884
|
-
__publicField(this, "ResumeRunner", (workerId, runnerId) => {
|
|
2885
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2886
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2887
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Resume();
|
|
2838
|
+
if (runnerIds.length === 0) {
|
|
2839
|
+
if (command === "UpdateOptions") {
|
|
2840
|
+
return __privateGet(this, _workersEx)[workerId][command](executionProfile);
|
|
2841
|
+
} else {
|
|
2842
|
+
return __privateGet(this, _workersEx)[workerId][command]();
|
|
2843
|
+
}
|
|
2844
|
+
} else {
|
|
2845
|
+
const retVal = [];
|
|
2846
|
+
runnerIds.forEach((runnerId) => {
|
|
2847
|
+
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2848
|
+
if (command === "UpdateOptions") {
|
|
2849
|
+
retVal.push(__privateGet(this, _workersEx)[workerId].runnersEx[runnerId][command](executionProfile));
|
|
2850
|
+
} else {
|
|
2851
|
+
retVal.push(__privateGet(this, _workersEx)[workerId].runnersEx[runnerId][command]());
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
});
|
|
2855
|
+
return retVal;
|
|
2888
2856
|
}
|
|
2889
2857
|
}
|
|
2890
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2891
|
-
});
|
|
2892
|
-
__publicField(this, "TerminateAllRunners", (workerId) => {
|
|
2893
|
-
if (__privateGet(this, _workersEx)[workerId]) {
|
|
2894
|
-
return __privateGet(this, _workersEx)[workerId].Terminate();
|
|
2895
|
-
}
|
|
2896
2858
|
return [];
|
|
2897
2859
|
});
|
|
2898
|
-
__publicField(this, "
|
|
2899
|
-
|
|
2900
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2901
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Terminate();
|
|
2902
|
-
}
|
|
2903
|
-
}
|
|
2904
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2860
|
+
__publicField(this, "StopRunners", (workerId, runnerIds) => {
|
|
2861
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Stop");
|
|
2905
2862
|
});
|
|
2906
|
-
__publicField(this, "
|
|
2907
|
-
|
|
2908
|
-
return __privateGet(this, _workersEx)[workerId].Reset();
|
|
2909
|
-
}
|
|
2910
|
-
return [];
|
|
2863
|
+
__publicField(this, "StartRunners", (workerId, runnerIds) => {
|
|
2864
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Start");
|
|
2911
2865
|
});
|
|
2912
|
-
__publicField(this, "
|
|
2913
|
-
|
|
2914
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2915
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Reset();
|
|
2916
|
-
}
|
|
2917
|
-
}
|
|
2918
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2866
|
+
__publicField(this, "PauseRunners", (workerId, runnerIds) => {
|
|
2867
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Pause");
|
|
2919
2868
|
});
|
|
2920
|
-
__publicField(this, "
|
|
2921
|
-
|
|
2922
|
-
return __privateGet(this, _workersEx)[workerId].Execute();
|
|
2923
|
-
}
|
|
2924
|
-
return [];
|
|
2869
|
+
__publicField(this, "ResumeRunners", (workerId, runnerIds) => {
|
|
2870
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Resume");
|
|
2925
2871
|
});
|
|
2926
|
-
__publicField(this, "
|
|
2927
|
-
|
|
2928
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2929
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].Execute();
|
|
2930
|
-
}
|
|
2931
|
-
}
|
|
2932
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2872
|
+
__publicField(this, "ExecuteRunners", (workerId, runnerIds) => {
|
|
2873
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Execute");
|
|
2933
2874
|
});
|
|
2934
|
-
__publicField(this, "
|
|
2935
|
-
|
|
2936
|
-
return __privateGet(this, _workersEx)[workerId].UpdateOptions(executionProfile);
|
|
2937
|
-
}
|
|
2938
|
-
return [];
|
|
2875
|
+
__publicField(this, "ResetRunners", (workerId, runnerIds) => {
|
|
2876
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Reset");
|
|
2939
2877
|
});
|
|
2940
|
-
|
|
2941
|
-
return
|
|
2942
|
-
workerManagerId: __privateGet(this, _id),
|
|
2943
|
-
workerId,
|
|
2944
|
-
runnerId,
|
|
2945
|
-
result: false
|
|
2946
|
-
};
|
|
2878
|
+
__publicField(this, "TerminateRunners", (workerId, runnerIds) => {
|
|
2879
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "Terminate");
|
|
2947
2880
|
});
|
|
2948
|
-
__publicField(this, "
|
|
2949
|
-
|
|
2950
|
-
if (__privateGet(this, _workersEx)[workerId].runnersEx[runnerId]) {
|
|
2951
|
-
return __privateGet(this, _workersEx)[workerId].runnersEx[runnerId].UpdateOptions(executionProfile);
|
|
2952
|
-
}
|
|
2953
|
-
}
|
|
2954
|
-
return __privateGet(this, _ExecuteRunnerActionResultFalse).call(this, workerId, runnerId);
|
|
2881
|
+
__publicField(this, "UpdateRunners", (workerId, runnerIds, executionProfile) => {
|
|
2882
|
+
return __privateGet(this, _ExecuteCommandOnRunners).call(this, workerId, runnerIds, "UpdateOptions", executionProfile);
|
|
2955
2883
|
});
|
|
2956
2884
|
__privateAdd(this, _SyncRunnerData, (runnerEx, runner) => {
|
|
2957
2885
|
runnerEx.iteration = runner.iteration;
|
|
@@ -3094,7 +3022,7 @@ _UpdateOptionsWorker = new WeakMap();
|
|
|
3094
3022
|
_TerminateWorker = new WeakMap();
|
|
3095
3023
|
_BroadcastCommandToAllRunners = new WeakMap();
|
|
3096
3024
|
_HandleAllWorkers = new WeakMap();
|
|
3097
|
-
|
|
3025
|
+
_ExecuteCommandOnRunners = new WeakMap();
|
|
3098
3026
|
_STSWorkerManager_instances = new WeakSet();
|
|
3099
3027
|
//GetWorkersEx = async (messageId: string, workerEx: IWorkerEx): Promise<IWorkers> => {
|
|
3100
3028
|
//const retVal2 = await this.#PostMessageToWorkerGetRunners(workerEx, eIWMessageCommands.GetRunners);
|