@nsshunt/stsrunnerframework 1.0.79 → 1.0.81
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 +98 -60
- package/dist/stsrunnerframework.mjs.map +1 -1
- package/dist/stsrunnerframework.umd.js +98 -60
- package/dist/stsrunnerframework.umd.js.map +1 -1
- package/package.json +1 -1
- package/types/commonTypes.d.ts +24 -24
- package/types/commonTypes.d.ts.map +1 -1
- package/types/workerManager.d.ts +8 -8
- package/types/workerManager.d.ts.map +1 -1
|
@@ -2049,8 +2049,7 @@ class STSWorkerManager {
|
|
|
2049
2049
|
if (runnerEx) {
|
|
2050
2050
|
if (runnerEx.publishInstrumentController) {
|
|
2051
2051
|
__privateGet(this, _debug2).call(this, chalk.grey(`Ending publish for runner: [${JSON.stringify(runnerEx.asyncRunnerContext)}]`));
|
|
2052
|
-
|
|
2053
|
-
await Sleep(250);
|
|
2052
|
+
runnerEx.publishInstrumentController.EndPublish();
|
|
2054
2053
|
}
|
|
2055
2054
|
const runner = this.CreateRunnerCopy(runnerEx);
|
|
2056
2055
|
__privateGet(this, _archiveList).push(runner);
|
|
@@ -2107,14 +2106,14 @@ class STSWorkerManager {
|
|
|
2107
2106
|
ExecuteRunner: (runner) => __privateGet(this, _ExecuteRunner2).call(this, stsWorkerEx, runner),
|
|
2108
2107
|
UpdateOptionsRunner: (runner, executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, stsWorkerEx, runner, executionProfile),
|
|
2109
2108
|
// Commands to execute on all runners
|
|
2110
|
-
Start:
|
|
2111
|
-
Stop:
|
|
2112
|
-
Pause:
|
|
2113
|
-
Resume:
|
|
2114
|
-
Terminate:
|
|
2115
|
-
Reset:
|
|
2116
|
-
Execute:
|
|
2117
|
-
UpdateOptions:
|
|
2109
|
+
Start: () => __privateGet(this, _StartWorker).call(this, stsWorkerEx),
|
|
2110
|
+
Stop: () => __privateGet(this, _StopWorker).call(this, stsWorkerEx),
|
|
2111
|
+
Pause: () => __privateGet(this, _PauseWorker).call(this, stsWorkerEx),
|
|
2112
|
+
Resume: () => __privateGet(this, _ResumeWorker).call(this, stsWorkerEx),
|
|
2113
|
+
Terminate: () => __privateGet(this, _TerminateWorker).call(this, stsWorkerEx),
|
|
2114
|
+
Reset: () => __privateGet(this, _ResetWorker).call(this, stsWorkerEx),
|
|
2115
|
+
Execute: () => __privateGet(this, _ExecuteWorker).call(this, stsWorkerEx),
|
|
2116
|
+
UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile)
|
|
2118
2117
|
};
|
|
2119
2118
|
if (__privateGet(this, _STSInstrumentController)) {
|
|
2120
2119
|
__privateGet(this, _STSInstrumentController).LogEx(chalk.yellow(`pid: [${process.pid}] Creating new worker: [${stsWorkerEx.id}]`));
|
|
@@ -2187,7 +2186,7 @@ class STSWorkerManager {
|
|
|
2187
2186
|
processMessage(publishMessagePayload);
|
|
2188
2187
|
});
|
|
2189
2188
|
} else {
|
|
2190
|
-
stsWorkerEx.messagePort.onmessage =
|
|
2189
|
+
stsWorkerEx.messagePort.onmessage = (data) => {
|
|
2191
2190
|
publishMessagePayload = data.data;
|
|
2192
2191
|
processMessage(publishMessagePayload);
|
|
2193
2192
|
};
|
|
@@ -2311,14 +2310,14 @@ class STSWorkerManager {
|
|
|
2311
2310
|
rx: 0,
|
|
2312
2311
|
tx: 0
|
|
2313
2312
|
},
|
|
2314
|
-
Start:
|
|
2315
|
-
Stop:
|
|
2316
|
-
Pause:
|
|
2317
|
-
Resume:
|
|
2318
|
-
Reset:
|
|
2319
|
-
Execute:
|
|
2320
|
-
Terminate:
|
|
2321
|
-
UpdateOptions:
|
|
2313
|
+
Start: () => __privateGet(this, _StartRunner2).call(this, workerEx, runnerEx),
|
|
2314
|
+
Stop: () => __privateGet(this, _StopRunner2).call(this, workerEx, runnerEx),
|
|
2315
|
+
Pause: () => __privateGet(this, _PauseRunner2).call(this, workerEx, runnerEx),
|
|
2316
|
+
Resume: () => __privateGet(this, _ResumeRunner2).call(this, workerEx, runnerEx),
|
|
2317
|
+
Reset: () => __privateGet(this, _ResetRunner2).call(this, workerEx, runnerEx),
|
|
2318
|
+
Execute: () => __privateGet(this, _ExecuteRunner2).call(this, workerEx, runnerEx),
|
|
2319
|
+
Terminate: () => __privateGet(this, _TerminateRunner2).call(this, workerEx, runnerEx),
|
|
2320
|
+
UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsRunner).call(this, workerEx, runnerEx, executionProfile),
|
|
2322
2321
|
on: (eventName, cb) => {
|
|
2323
2322
|
if (!workerEx.runnersEvents[runnerEx.id]) {
|
|
2324
2323
|
workerEx.runnersEvents[runnerEx.id] = [];
|
|
@@ -2346,81 +2345,121 @@ class STSWorkerManager {
|
|
|
2346
2345
|
__privateGet(this, _debug2).call(this, `#PostMessageToWorker`);
|
|
2347
2346
|
workerEx.messagePort.postMessage({ command, payload });
|
|
2348
2347
|
});
|
|
2349
|
-
__privateAdd(this, _StartRunner2,
|
|
2348
|
+
__privateAdd(this, _StartRunner2, (workerEx, runnerEx) => {
|
|
2350
2349
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StartRunner, {
|
|
2351
2350
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2352
2351
|
});
|
|
2353
|
-
return
|
|
2352
|
+
return {
|
|
2353
|
+
workerManagerId: __privateGet(this, _id),
|
|
2354
|
+
workerId: workerEx.id,
|
|
2355
|
+
runnerId: runnerEx.id,
|
|
2356
|
+
result: true
|
|
2357
|
+
};
|
|
2354
2358
|
});
|
|
2355
|
-
__privateAdd(this, _ResetRunner2,
|
|
2359
|
+
__privateAdd(this, _ResetRunner2, (workerEx, runnerEx) => {
|
|
2356
2360
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResetRunner, {
|
|
2357
2361
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2358
2362
|
});
|
|
2359
|
-
return
|
|
2363
|
+
return {
|
|
2364
|
+
workerManagerId: __privateGet(this, _id),
|
|
2365
|
+
workerId: workerEx.id,
|
|
2366
|
+
runnerId: runnerEx.id,
|
|
2367
|
+
result: true
|
|
2368
|
+
};
|
|
2360
2369
|
});
|
|
2361
|
-
__privateAdd(this, _ExecuteRunner2,
|
|
2370
|
+
__privateAdd(this, _ExecuteRunner2, (workerEx, runnerEx) => {
|
|
2362
2371
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ExecuteRunner, {
|
|
2363
2372
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2364
2373
|
});
|
|
2365
|
-
return
|
|
2374
|
+
return {
|
|
2375
|
+
workerManagerId: __privateGet(this, _id),
|
|
2376
|
+
workerId: workerEx.id,
|
|
2377
|
+
runnerId: runnerEx.id,
|
|
2378
|
+
result: true
|
|
2379
|
+
};
|
|
2366
2380
|
});
|
|
2367
|
-
__privateAdd(this, _StopRunner2,
|
|
2381
|
+
__privateAdd(this, _StopRunner2, (workerEx, runnerEx) => {
|
|
2368
2382
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.StopRunner, {
|
|
2369
2383
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2370
2384
|
});
|
|
2371
|
-
return
|
|
2385
|
+
return {
|
|
2386
|
+
workerManagerId: __privateGet(this, _id),
|
|
2387
|
+
workerId: workerEx.id,
|
|
2388
|
+
runnerId: runnerEx.id,
|
|
2389
|
+
result: true
|
|
2390
|
+
};
|
|
2372
2391
|
});
|
|
2373
|
-
__privateAdd(this, _TerminateRunner2,
|
|
2392
|
+
__privateAdd(this, _TerminateRunner2, (workerEx, runnerEx) => {
|
|
2374
2393
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.TerminateRunner, {
|
|
2375
2394
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2376
2395
|
});
|
|
2377
|
-
return
|
|
2396
|
+
return {
|
|
2397
|
+
workerManagerId: __privateGet(this, _id),
|
|
2398
|
+
workerId: workerEx.id,
|
|
2399
|
+
runnerId: runnerEx.id,
|
|
2400
|
+
result: true
|
|
2401
|
+
};
|
|
2378
2402
|
});
|
|
2379
|
-
__privateAdd(this, _PauseRunner2,
|
|
2403
|
+
__privateAdd(this, _PauseRunner2, (workerEx, runnerEx) => {
|
|
2380
2404
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.PauseRunner, {
|
|
2381
2405
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2382
2406
|
});
|
|
2383
|
-
return
|
|
2407
|
+
return {
|
|
2408
|
+
workerManagerId: __privateGet(this, _id),
|
|
2409
|
+
workerId: workerEx.id,
|
|
2410
|
+
runnerId: runnerEx.id,
|
|
2411
|
+
result: true
|
|
2412
|
+
};
|
|
2384
2413
|
});
|
|
2385
|
-
__privateAdd(this, _ResumeRunner2,
|
|
2414
|
+
__privateAdd(this, _ResumeRunner2, (workerEx, runnerEx) => {
|
|
2386
2415
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.ResumeRunner, {
|
|
2387
2416
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2388
2417
|
});
|
|
2389
|
-
return
|
|
2418
|
+
return {
|
|
2419
|
+
workerManagerId: __privateGet(this, _id),
|
|
2420
|
+
workerId: workerEx.id,
|
|
2421
|
+
runnerId: runnerEx.id,
|
|
2422
|
+
result: true
|
|
2423
|
+
};
|
|
2390
2424
|
});
|
|
2391
|
-
__privateAdd(this, _UpdateOptionsRunner,
|
|
2425
|
+
__privateAdd(this, _UpdateOptionsRunner, (workerEx, runnerEx, executionProfile) => {
|
|
2392
2426
|
runnerEx.options.executionProfile = { ...executionProfile };
|
|
2393
2427
|
__privateGet(this, _PostMessageToWorker).call(this, workerEx, eIWMessageCommands.UpdateOptions, {
|
|
2394
2428
|
runner: this.CreateRunnerCopyNoHistory(runnerEx)
|
|
2395
2429
|
});
|
|
2396
|
-
return
|
|
2430
|
+
return {
|
|
2431
|
+
workerManagerId: __privateGet(this, _id),
|
|
2432
|
+
workerId: workerEx.id,
|
|
2433
|
+
runnerId: runnerEx.id,
|
|
2434
|
+
result: true
|
|
2435
|
+
};
|
|
2397
2436
|
});
|
|
2398
|
-
__privateAdd(this, _PauseWorker,
|
|
2437
|
+
__privateAdd(this, _PauseWorker, (workerEx) => {
|
|
2399
2438
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _PauseRunner2));
|
|
2400
2439
|
});
|
|
2401
|
-
__privateAdd(this, _ResumeWorker,
|
|
2440
|
+
__privateAdd(this, _ResumeWorker, (workerEx) => {
|
|
2402
2441
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ResumeRunner2));
|
|
2403
2442
|
});
|
|
2404
|
-
__privateAdd(this, _StopWorker,
|
|
2443
|
+
__privateAdd(this, _StopWorker, (workerEx) => {
|
|
2405
2444
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _StopRunner2));
|
|
2406
2445
|
});
|
|
2407
|
-
__privateAdd(this, _StartWorker,
|
|
2446
|
+
__privateAdd(this, _StartWorker, (workerEx) => {
|
|
2408
2447
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _StartRunner2));
|
|
2409
2448
|
});
|
|
2410
|
-
__privateAdd(this, _ResetWorker,
|
|
2449
|
+
__privateAdd(this, _ResetWorker, (workerEx) => {
|
|
2411
2450
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ResetRunner2));
|
|
2412
2451
|
});
|
|
2413
|
-
__privateAdd(this, _ExecuteWorker,
|
|
2452
|
+
__privateAdd(this, _ExecuteWorker, (workerEx) => {
|
|
2414
2453
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _ExecuteRunner2));
|
|
2415
2454
|
});
|
|
2416
2455
|
// IExecutionProfile
|
|
2417
|
-
__privateAdd(this, _UpdateOptionsWorker,
|
|
2456
|
+
__privateAdd(this, _UpdateOptionsWorker, (workerEx, executionProfile) => {
|
|
2418
2457
|
return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptionsRunner), executionProfile);
|
|
2419
2458
|
});
|
|
2420
|
-
__privateAdd(this, _BroadcastCommandToAllRunners,
|
|
2459
|
+
__privateAdd(this, _BroadcastCommandToAllRunners, (workerEx, command, executionProfile) => {
|
|
2421
2460
|
try {
|
|
2422
|
-
const executeCommand =
|
|
2423
|
-
const result = executionProfile ?
|
|
2461
|
+
const executeCommand = (runnerEx) => {
|
|
2462
|
+
const result = executionProfile ? command(workerEx, runnerEx, executionProfile) : command(workerEx, runnerEx);
|
|
2424
2463
|
return {
|
|
2425
2464
|
workerManagerId: __privateGet(this, _id),
|
|
2426
2465
|
workerId: workerEx.id,
|
|
@@ -2428,16 +2467,15 @@ class STSWorkerManager {
|
|
|
2428
2467
|
result
|
|
2429
2468
|
};
|
|
2430
2469
|
};
|
|
2431
|
-
|
|
2432
|
-
return await Promise.all(promises);
|
|
2470
|
+
return Object.values(workerEx.runnersEx).map((runnerEx) => executeCommand(runnerEx));
|
|
2433
2471
|
} catch (error) {
|
|
2434
2472
|
console.error(`Error in STSTestWorker:WorkerCommand: [${error}]`);
|
|
2435
2473
|
return [];
|
|
2436
2474
|
}
|
|
2437
2475
|
});
|
|
2438
|
-
__privateAdd(this, _TerminateWorker,
|
|
2476
|
+
__privateAdd(this, _TerminateWorker, (workerEx) => {
|
|
2439
2477
|
try {
|
|
2440
|
-
const retVal =
|
|
2478
|
+
const retVal = __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
|
|
2441
2479
|
if (workerEx.worker) {
|
|
2442
2480
|
workerEx.worker.terminate();
|
|
2443
2481
|
__privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
|
|
@@ -2477,25 +2515,25 @@ class STSWorkerManager {
|
|
|
2477
2515
|
return busyWorker;
|
|
2478
2516
|
});
|
|
2479
2517
|
// IExecuteRunnerActionResult[]
|
|
2480
|
-
__privateAdd(this, _HandleAllWorkers,
|
|
2481
|
-
const
|
|
2518
|
+
__privateAdd(this, _HandleAllWorkers, (action, options) => {
|
|
2519
|
+
const retVal = Object.values(this.WorkersEx).map((worker) => {
|
|
2482
2520
|
if (action === "UpdateOptions") {
|
|
2483
2521
|
return {
|
|
2484
2522
|
workerManagerId: __privateGet(this, _id),
|
|
2485
2523
|
workerId: worker.id,
|
|
2486
|
-
executeRunnerActionResults:
|
|
2524
|
+
executeRunnerActionResults: worker[action](options)
|
|
2487
2525
|
};
|
|
2488
2526
|
} else {
|
|
2489
2527
|
return {
|
|
2490
2528
|
workerManagerId: __privateGet(this, _id),
|
|
2491
2529
|
workerId: worker.id,
|
|
2492
|
-
executeRunnerActionResults:
|
|
2530
|
+
executeRunnerActionResults: worker[action]()
|
|
2493
2531
|
};
|
|
2494
2532
|
}
|
|
2495
2533
|
});
|
|
2496
|
-
return
|
|
2534
|
+
return retVal;
|
|
2497
2535
|
});
|
|
2498
|
-
__publicField(this, "StartAllWorkers",
|
|
2536
|
+
__publicField(this, "StartAllWorkers", () => {
|
|
2499
2537
|
return __privateGet(this, _HandleAllWorkers).call(this, "Start");
|
|
2500
2538
|
});
|
|
2501
2539
|
__publicField(this, "StopAllWorkers", () => {
|
|
@@ -2504,19 +2542,19 @@ class STSWorkerManager {
|
|
|
2504
2542
|
__publicField(this, "PauseAllWorkers", () => {
|
|
2505
2543
|
return __privateGet(this, _HandleAllWorkers).call(this, "Pause");
|
|
2506
2544
|
});
|
|
2507
|
-
__publicField(this, "ResumeAllWorkers",
|
|
2545
|
+
__publicField(this, "ResumeAllWorkers", () => {
|
|
2508
2546
|
return __privateGet(this, _HandleAllWorkers).call(this, "Resume");
|
|
2509
2547
|
});
|
|
2510
|
-
__publicField(this, "ExecuteAllWorkers",
|
|
2548
|
+
__publicField(this, "ExecuteAllWorkers", () => {
|
|
2511
2549
|
return __privateGet(this, _HandleAllWorkers).call(this, "Execute");
|
|
2512
2550
|
});
|
|
2513
|
-
__publicField(this, "ResetAllWorkers",
|
|
2551
|
+
__publicField(this, "ResetAllWorkers", () => {
|
|
2514
2552
|
return __privateGet(this, _HandleAllWorkers).call(this, "Reset");
|
|
2515
2553
|
});
|
|
2516
|
-
__publicField(this, "TerminateAllWorkers",
|
|
2554
|
+
__publicField(this, "TerminateAllWorkers", () => {
|
|
2517
2555
|
return __privateGet(this, _HandleAllWorkers).call(this, "Terminate");
|
|
2518
2556
|
});
|
|
2519
|
-
__publicField(this, "UpdateAllWorkers",
|
|
2557
|
+
__publicField(this, "UpdateAllWorkers", (options) => {
|
|
2520
2558
|
return __privateGet(this, _HandleAllWorkers).call(this, "UpdateOptions", options);
|
|
2521
2559
|
});
|
|
2522
2560
|
__privateSet(this, _id, v4());
|