@nsshunt/stsrunnerframework 1.0.66 → 1.0.67
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 +26 -12
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +26 -12
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +2 -2
- package/types/commonTypes.d.ts.map +1 -1
- package/types/wmworkerProcess.d.ts.map +1 -1
- package/types/workerManager.d.ts.map +1 -1
|
@@ -2025,8 +2025,8 @@ class STSWorkerManager {
|
|
|
2025
2025
|
//#agentSession: string = null;
|
|
2026
2026
|
__privateAdd(this, _workersEx, {});
|
|
2027
2027
|
__privateAdd(this, _options4);
|
|
2028
|
-
__privateAdd(this, _STSInstrumentController);
|
|
2029
|
-
__privateAdd(this, _telemetryProcessor);
|
|
2028
|
+
__privateAdd(this, _STSInstrumentController, null);
|
|
2029
|
+
__privateAdd(this, _telemetryProcessor, null);
|
|
2030
2030
|
__privateAdd(this, _debug2, (message2) => {
|
|
2031
2031
|
console.log(chalk$1.cyan(`pid: [${process.pid}] STSWorkerManager::${message2}`));
|
|
2032
2032
|
});
|
|
@@ -2073,7 +2073,9 @@ class STSWorkerManager {
|
|
|
2073
2073
|
Execute: async () => __privateGet(this, _ExecuteWorker).call(this, stsWorkerEx),
|
|
2074
2074
|
UpdateOptions: async (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile)
|
|
2075
2075
|
};
|
|
2076
|
-
__privateGet(this, _STSInstrumentController)
|
|
2076
|
+
if (__privateGet(this, _STSInstrumentController)) {
|
|
2077
|
+
__privateGet(this, _STSInstrumentController).LogEx(chalk$1.yellow(`pid: [${process.pid}] Creating new worker: [${stsWorkerEx.id}]`));
|
|
2078
|
+
}
|
|
2077
2079
|
__privateGet(this, _debug2).call(this, `Adding worker: [${stsWorkerEx.id}]`);
|
|
2078
2080
|
__privateGet(this, _debug2).call(this, `AddWorker::workerThreadWorkerOptions: [${stsWorkerEx.workerThreadWorkerOptions.id}]`);
|
|
2079
2081
|
if (stsWorkerEx.workerThreadWorkerOptions.mocked) {
|
|
@@ -2153,7 +2155,9 @@ class STSWorkerManager {
|
|
|
2153
2155
|
const runnerEx = __privateGet(this, _CreateAsyncRunner).call(this, stsWorkerEx, runnerOptions);
|
|
2154
2156
|
stsWorkerEx.runnersEx[runnerEx.id] = runnerEx;
|
|
2155
2157
|
__privateGet(this, _SetRunnerIntoWorker).call(this, stsWorkerEx, runnerEx);
|
|
2156
|
-
runnerEx.publishInstrumentController
|
|
2158
|
+
if (runnerEx.publishInstrumentController) {
|
|
2159
|
+
runnerEx.publishInstrumentController.LogEx(chalk$1.green(`Added runner: [${runnerEx.id}] into worker: [${stsWorkerEx.id}]`));
|
|
2160
|
+
}
|
|
2157
2161
|
return runnerEx;
|
|
2158
2162
|
});
|
|
2159
2163
|
__privateAdd(this, _SetRunnerIntoWorker, (workerEx, runnerEx) => {
|
|
@@ -2172,7 +2176,9 @@ class STSWorkerManager {
|
|
|
2172
2176
|
} else {
|
|
2173
2177
|
runnerEx.instrumentData.message = [];
|
|
2174
2178
|
}
|
|
2175
|
-
__privateGet(this, _telemetryProcessor)
|
|
2179
|
+
if (runnerEx.publishInstrumentController && __privateGet(this, _telemetryProcessor)) {
|
|
2180
|
+
__privateGet(this, _telemetryProcessor).ProcessTelemetry(runnerEx.publishInstrumentController, runnerEx.instrumentData);
|
|
2181
|
+
}
|
|
2176
2182
|
__privateGet(this, _EmitEvent).call(this, "Telemetry", workerEx, runner.id);
|
|
2177
2183
|
}
|
|
2178
2184
|
});
|
|
@@ -2203,7 +2209,9 @@ class STSWorkerManager {
|
|
|
2203
2209
|
console.log(chalk$1.green(`ProcessCompleted: [${JSON.stringify(runner)}]`));
|
|
2204
2210
|
});
|
|
2205
2211
|
__privateAdd(this, _CreateAsyncRunner, (workerEx, runnerOptions) => {
|
|
2206
|
-
__privateGet(this, _STSInstrumentController)
|
|
2212
|
+
if (__privateGet(this, _STSInstrumentController)) {
|
|
2213
|
+
__privateGet(this, _STSInstrumentController).LogEx(chalk$1.yellow(`Creating new async runner: [${runnerOptions.id}]`));
|
|
2214
|
+
}
|
|
2207
2215
|
const asyncRunnerContext = {
|
|
2208
2216
|
nid: `${workerEx.workerThreadWorkerOptions.hostName}${ModelDelimeter.COMPONENT_SEPERATOR}${workerEx.workerThreadWorkerOptions.agentId}-${workerEx.workerThreadWorkerOptions.userAgent}${ModelDelimeter.NID_SEPERATOR}${workerEx.id}${ModelDelimeter.SEPERATOR}${runnerOptions.id}`,
|
|
2209
2217
|
id: runnerOptions.id,
|
|
@@ -2215,7 +2223,7 @@ class STSWorkerManager {
|
|
|
2215
2223
|
id: runnerOptions.id,
|
|
2216
2224
|
state: IRunnerState.created,
|
|
2217
2225
|
iteration: 0,
|
|
2218
|
-
publishInstrumentController: __privateGet(this, _STSInstrumentController).AddPublishInstrumentController(asyncRunnerContext),
|
|
2226
|
+
publishInstrumentController: __privateGet(this, _STSInstrumentController) ? __privateGet(this, _STSInstrumentController).AddPublishInstrumentController(asyncRunnerContext) : void 0,
|
|
2219
2227
|
asyncRunnerContext,
|
|
2220
2228
|
options: runnerOptions,
|
|
2221
2229
|
instrumentData: {
|
|
@@ -2314,11 +2322,15 @@ class STSWorkerManager {
|
|
|
2314
2322
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.TerminateRunner, {
|
|
2315
2323
|
runner: __privateMethod(this, _STSWorkerManager_instances, CreateRunnerCopy_fn).call(this, runnerEx)
|
|
2316
2324
|
});
|
|
2317
|
-
runnerEx.publishInstrumentController
|
|
2325
|
+
if (runnerEx.publishInstrumentController) {
|
|
2326
|
+
runnerEx.publishInstrumentController.LogEx(`Terminating runner: [${runnerEx.id}]`);
|
|
2327
|
+
}
|
|
2318
2328
|
await Sleep(250);
|
|
2319
2329
|
console.log(chalk$1.magenta(`Ending publish for runner: [${JSON.stringify(runnerEx.asyncRunnerContext)}]`));
|
|
2320
|
-
|
|
2321
|
-
|
|
2330
|
+
if (runnerEx.publishInstrumentController) {
|
|
2331
|
+
await runnerEx.publishInstrumentController.EndPublish();
|
|
2332
|
+
await Sleep(250);
|
|
2333
|
+
}
|
|
2322
2334
|
delete workerEx.runnersEx[runnerEx.id];
|
|
2323
2335
|
console.log(chalk$1.magenta(`Completed Terminate for runner: [${JSON.stringify(runnerEx.asyncRunnerContext)}]`));
|
|
2324
2336
|
resolve(true);
|
|
@@ -2516,8 +2528,10 @@ class STSWorkerManager {
|
|
|
2516
2528
|
} else {
|
|
2517
2529
|
__privateSet(this, _options4, {});
|
|
2518
2530
|
}
|
|
2519
|
-
|
|
2520
|
-
|
|
2531
|
+
if (__privateGet(this, _options4).publishInstrumentController) {
|
|
2532
|
+
__privateSet(this, _STSInstrumentController, __privateGet(this, _options4).publishInstrumentController);
|
|
2533
|
+
__privateSet(this, _telemetryProcessor, new TelemetryProcessor());
|
|
2534
|
+
}
|
|
2521
2535
|
}
|
|
2522
2536
|
get WorkersEx() {
|
|
2523
2537
|
return __privateGet(this, _workersEx);
|