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