@nsshunt/stsrunnerframework 1.0.34 → 1.0.36
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.
- package/dist/stsrunnerframework.mjs +31 -8
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +31 -8
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +3 -3
- package/types/commonTypes.d.ts.map +1 -1
- package/types/workerManager.d.ts.map +1 -1
|
@@ -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, _debug, _SetMessagePort, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _StartRunner, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _debug2, _STSWorkerManager_instances, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _ProcessCompleted, _CreateAsyncRunner, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2;
|
|
12
|
+
var _collectorCollectorPort, _runners, _options, _debug, _SetMessagePort, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _StartRunner, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _debug2, _STSWorkerManager_instances, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _ProcessCompleted, _CreateAsyncRunner, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _BroadcastCommandToAllRunners, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _BroadcastUpdateCommandToAllRunners, _UpdateOptionsWorker, _TerminateWorker, _UpdateOptions2;
|
|
13
13
|
import { Sleep, ModelDelimeter } from "@nsshunt/stsutils";
|
|
14
14
|
import { Gauge } from "@nsshunt/stsobservability";
|
|
15
15
|
const URI_BASE_VUEUTILS = "/";
|
|
@@ -1946,7 +1946,7 @@ class STSWorkerManager {
|
|
|
1946
1946
|
TerminateRunner: (runner) => __privateGet(this, _TerminateRunner2).call(this, stsWorkerEx, runner),
|
|
1947
1947
|
ResetRunner: (runner) => __privateGet(this, _ResetRunner2).call(this, stsWorkerEx, runner),
|
|
1948
1948
|
ExecuteRunner: (runner) => __privateGet(this, _ExecuteRunner2).call(this, stsWorkerEx, runner),
|
|
1949
|
-
UpdateOptionsRunner: (runner,
|
|
1949
|
+
UpdateOptionsRunner: (runner, executionProfile) => __privateGet(this, _UpdateOptions2).call(this, stsWorkerEx, runner, executionProfile),
|
|
1950
1950
|
// Commands to execute on all runners
|
|
1951
1951
|
Start: async () => __privateGet(this, _StartWorker).call(this, stsWorkerEx),
|
|
1952
1952
|
Stop: async () => __privateGet(this, _StopWorker).call(this, stsWorkerEx),
|
|
@@ -1955,7 +1955,7 @@ class STSWorkerManager {
|
|
|
1955
1955
|
Terminate: async () => __privateGet(this, _TerminateWorker).call(this, stsWorkerEx),
|
|
1956
1956
|
Reset: async () => __privateGet(this, _ResetWorker).call(this, stsWorkerEx),
|
|
1957
1957
|
Execute: async () => __privateGet(this, _ExecuteWorker).call(this, stsWorkerEx),
|
|
1958
|
-
UpdateOptions: async (
|
|
1958
|
+
UpdateOptions: async (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile)
|
|
1959
1959
|
};
|
|
1960
1960
|
__privateGet(this, _STSInstrumentController).LogEx(chalk.yellow(`pid: [${process.pid}] Creating new worker: [${stsWorkerEx.id}]`));
|
|
1961
1961
|
__privateGet(this, _debug2).call(this, `Adding worker: [${stsWorkerEx.id}]`);
|
|
@@ -2106,7 +2106,7 @@ class STSWorkerManager {
|
|
|
2106
2106
|
Reset: async () => __privateGet(this, _ResetRunner2).call(this, workerEx, runnerEx),
|
|
2107
2107
|
Execute: async () => __privateGet(this, _ExecuteRunner2).call(this, workerEx, runnerEx),
|
|
2108
2108
|
Terminate: async () => __privateGet(this, _TerminateRunner2).call(this, workerEx, runnerEx),
|
|
2109
|
-
UpdateOptions: async (
|
|
2109
|
+
UpdateOptions: async (executionProfile) => __privateGet(this, _UpdateOptions2).call(this, workerEx, runnerEx, executionProfile),
|
|
2110
2110
|
on: (eventName, cb) => {
|
|
2111
2111
|
if (!workerEx.runnersEvents[runnerEx.id]) {
|
|
2112
2112
|
workerEx.runnersEvents[runnerEx.id] = [];
|
|
@@ -2235,8 +2235,30 @@ class STSWorkerManager {
|
|
|
2235
2235
|
__privateAdd(this, _ExecuteWorker, async (workerEx) => {
|
|
2236
2236
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ExecuteRunner2));
|
|
2237
2237
|
});
|
|
2238
|
-
__privateAdd(this,
|
|
2239
|
-
|
|
2238
|
+
__privateAdd(this, _BroadcastUpdateCommandToAllRunners, async (workerEx, command, executionProfile) => {
|
|
2239
|
+
try {
|
|
2240
|
+
if (workerEx.state !== IWorkerState.stopped) {
|
|
2241
|
+
const promArray = [];
|
|
2242
|
+
const ids = Object.keys(workerEx.runnersEx);
|
|
2243
|
+
ids.forEach((id) => {
|
|
2244
|
+
const runnerEx = workerEx.runnersEx[id];
|
|
2245
|
+
if (executionProfile) {
|
|
2246
|
+
promArray.push(command(workerEx, runnerEx, executionProfile));
|
|
2247
|
+
} else {
|
|
2248
|
+
promArray.push(command(workerEx, runnerEx));
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
await Promise.all(promArray);
|
|
2252
|
+
}
|
|
2253
|
+
return true;
|
|
2254
|
+
} catch (error) {
|
|
2255
|
+
console.log(`Error in STSTestWorker:WorkerCommand: [${error}]`);
|
|
2256
|
+
return false;
|
|
2257
|
+
}
|
|
2258
|
+
});
|
|
2259
|
+
// IExecutionProfile
|
|
2260
|
+
__privateAdd(this, _UpdateOptionsWorker, async (workerEx, executionProfile) => {
|
|
2261
|
+
return __privateGet(this, _BroadcastUpdateCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptions2), executionProfile);
|
|
2240
2262
|
});
|
|
2241
2263
|
__privateAdd(this, _TerminateWorker, async (workerEx) => {
|
|
2242
2264
|
try {
|
|
@@ -2255,8 +2277,8 @@ class STSWorkerManager {
|
|
|
2255
2277
|
return false;
|
|
2256
2278
|
}
|
|
2257
2279
|
});
|
|
2258
|
-
__privateAdd(this, _UpdateOptions2, async (workerEx, runnerEx,
|
|
2259
|
-
runnerEx.options = { ...
|
|
2280
|
+
__privateAdd(this, _UpdateOptions2, async (workerEx, runnerEx, executionProfile) => {
|
|
2281
|
+
runnerEx.options.executionProfile = { ...executionProfile };
|
|
2260
2282
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
|
|
2261
2283
|
runner: __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx)
|
|
2262
2284
|
});
|
|
@@ -2346,6 +2368,7 @@ _StopWorker = new WeakMap();
|
|
|
2346
2368
|
_StartWorker = new WeakMap();
|
|
2347
2369
|
_ResetWorker = new WeakMap();
|
|
2348
2370
|
_ExecuteWorker = new WeakMap();
|
|
2371
|
+
_BroadcastUpdateCommandToAllRunners = new WeakMap();
|
|
2349
2372
|
_UpdateOptionsWorker = new WeakMap();
|
|
2350
2373
|
_TerminateWorker = new WeakMap();
|
|
2351
2374
|
_UpdateOptions2 = new WeakMap();
|