@nsshunt/stsrunnerframework 1.0.83 → 1.0.85

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.
@@ -13,7 +13,7 @@ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot
13
13
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
14
14
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
15
15
 
16
- var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _StartRunner, _StopRunnerByRunnerById, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _processLoopExecutor2, _debug2, _SetRunnerIntoWorker, _ProcessTelemetry, _EmitEvent, _RunnerStateChange, _RemoveRunnerFromCollection, _CreateAsyncRunner, _PostMessageToWorkerUsingDefaultChannel, _PostMessageToWorker, _StartRunner2, _ResetRunner2, _ExecuteRunner2, _StopRunner2, _TerminateRunner2, _PauseRunner2, _ResumeRunner2, _UpdateOptionsRunner, _PauseWorker, _ResumeWorker, _StopWorker, _StartWorker, _ResetWorker, _ExecuteWorker, _UpdateOptionsWorker, _BroadcastCommandToAllRunners, _TerminateWorker, _HandleAllWorkers;
16
+ var _collectorCollectorPort, _runners, _options, _workerId, _debug, _error, _processLoopExecutor, _SetMessagePort, _CreateRunnerEx2RunState, _UpdateRunnerStateById, _GetAllRunners, _CanExecuteNextIterationById, _IsCompletedById, _GetRunnerIterationById, _ResetRunnerIterationById, _IncRunnerIterationById, _GetRunnerInstanceById, _GetRunnerExecutionProfileById, _GetRunnerOptionsById, _SetRunnerOptionsById, _AddRunner, _WorkerInstance_instances, SleepImmediate_fn, _PostMessageToWorkerManagerById, _StartRunner, _StopRunnerByRunnerId, _StopAllRunners, _StopRunner, _TerminateRunner, _PauseRunner, _ResumeRunner, _ResetRunner, _ExecuteRunner, _UpdateOptions, _workersEx, _options2, _STSInstrumentController, _telemetryProcessor, _archiveList, _id, _processLoopExecutor2, _debug2, _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;
17
17
  const URI_BASE_VUEUTILS = "/";
18
18
  const STS_RF_RES_PREFIX = "STS_R_RF_";
19
19
  const STS_RF_RES_ENT_PREFIX = "STS_RE_RF_";
@@ -1540,25 +1540,30 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1540
1540
  }
1541
1541
  });
1542
1542
  __privateAdd(this, _processLoopExecutor, async () => {
1543
- const removeList = [];
1544
- const promArray = [];
1545
- for (const [, runner] of Object.entries(__privateGet(this, _runners))) {
1546
- if (runner.runner.state === IRunnerState.completed || runner.runner.state === IRunnerState.error || runner.runner.state === IRunnerState.stopped || runner.runner.state === IRunnerState.terminated) {
1547
- promArray.push(__privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.RemoveRunnerFromCollection, runner.runner.id));
1548
- removeList.push(runner.runner.id);
1549
- }
1550
- }
1551
- if (promArray.length > 0) {
1552
- await Promise.all(promArray);
1553
- setTimeout(() => {
1554
- __privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Removing runners from collection: [${removeList}]`));
1555
- for (let i = 0; i < removeList.length; i++) {
1556
- delete __privateGet(this, _runners)[removeList[i]];
1543
+ try {
1544
+ const removeList = [];
1545
+ const promArray = [];
1546
+ for (const [, runner] of Object.entries(__privateGet(this, _runners))) {
1547
+ if (runner.runner.state === IRunnerState.completed || runner.runner.state === IRunnerState.error || runner.runner.state === IRunnerState.stopped || runner.runner.state === IRunnerState.terminated) {
1548
+ promArray.push(__privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.RemoveRunnerFromCollection, runner.runner.id));
1549
+ removeList.push(runner.runner.id);
1557
1550
  }
1558
- __privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Remaining Runner Count: [${Object.keys(__privateGet(this, _runners)).length}]`));
1551
+ }
1552
+ if (promArray.length > 0) {
1553
+ await Promise.all(promArray);
1554
+ setTimeout(() => {
1555
+ __privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Removing runners from collection: [${removeList}]`));
1556
+ for (let i = 0; i < removeList.length; i++) {
1557
+ delete __privateGet(this, _runners)[removeList[i]];
1558
+ }
1559
+ __privateGet(this, _debug).call(this, chalk.grey(`WorkerInstance:#processLoopExecutor(): Remaining Runner Count: [${Object.keys(__privateGet(this, _runners)).length}]`));
1560
+ setTimeout(__privateGet(this, _processLoopExecutor), 1e3);
1561
+ }, 100);
1562
+ } else {
1559
1563
  setTimeout(__privateGet(this, _processLoopExecutor), 1e3);
1560
- }, 100);
1561
- } else {
1564
+ }
1565
+ } catch (error) {
1566
+ console.error(`#processLoopExecutor(): [${error}]`);
1562
1567
  setTimeout(__privateGet(this, _processLoopExecutor), 1e3);
1563
1568
  }
1564
1569
  });
@@ -1574,200 +1579,369 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1574
1579
  __privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.InstrumentTelemetry, id);
1575
1580
  });
1576
1581
  __privateAdd(this, _SetMessagePort, (workerMessagePort) => {
1577
- __privateGet(this, _debug).call(this, `SetMessagePort`);
1578
- __privateSet(this, _collectorCollectorPort, workerMessagePort.port);
1579
- if (isNode) {
1580
- __privateGet(this, _collectorCollectorPort).on("message", (data) => {
1581
- __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data)}`);
1582
- });
1583
- } else {
1584
- __privateGet(this, _collectorCollectorPort).onmessage = function(data) {
1585
- __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data.data)}`);
1582
+ try {
1583
+ __privateGet(this, _debug).call(this, `SetMessagePort`);
1584
+ __privateSet(this, _collectorCollectorPort, workerMessagePort.port);
1585
+ if (isNode) {
1586
+ __privateGet(this, _collectorCollectorPort).on("message", (data) => {
1587
+ __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data)}`);
1588
+ });
1589
+ } else {
1590
+ __privateGet(this, _collectorCollectorPort).onmessage = function(data) {
1591
+ __privateGet(this, _debug).call(this, `collectorCollectorPort onmessage: ${JSON.stringify(data.data)}`);
1592
+ };
1593
+ }
1594
+ const response = {
1595
+ command: eIWMessageCommands.MessagePortResponse,
1596
+ payload: {}
1586
1597
  };
1598
+ __privateGet(this, _collectorCollectorPort).postMessage(response);
1599
+ } catch (error) {
1600
+ console.error(`#SetMessagePort(): [${error}]`);
1587
1601
  }
1588
- const response = {
1589
- command: eIWMessageCommands.MessagePortResponse,
1590
- payload: {}
1591
- };
1592
- __privateGet(this, _collectorCollectorPort).postMessage(response);
1593
1602
  });
1594
1603
  __publicField(this, "CreateAsyncRunner", (testRunnerTelemetryPayload) => {
1595
1604
  return null;
1596
1605
  });
1597
1606
  __privateAdd(this, _CreateRunnerEx2RunState, async (runner, runnerInstance) => {
1598
- __privateGet(this, _runners)[runner.id] = {
1599
- runner,
1600
- runnerInstance
1601
- };
1602
- __privateGet(this, _runners)[runner.id].runner.iteration = 0;
1603
- __privateGet(this, _UpdateRunnerStateById).call(this, runner.id, IRunnerState.created);
1607
+ try {
1608
+ __privateGet(this, _runners)[runner.id] = {
1609
+ runner,
1610
+ runnerInstance
1611
+ };
1612
+ __privateGet(this, _runners)[runner.id].runner.iteration = 0;
1613
+ __privateGet(this, _UpdateRunnerStateById).call(this, runner.id, IRunnerState.created);
1614
+ } catch (error) {
1615
+ console.error(`#CreateRunnerEx2RunState(): [${error}]`);
1616
+ }
1604
1617
  });
1605
1618
  __privateAdd(this, _UpdateRunnerStateById, (id, state) => {
1606
- __privateGet(this, _runners)[id].runner.state = state;
1607
- __privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.RunnerStateChange, id);
1619
+ try {
1620
+ if (__privateGet(this, _runners)[id]) {
1621
+ __privateGet(this, _runners)[id].runner.state = state;
1622
+ __privateGet(this, _PostMessageToWorkerManagerById).call(this, eIWMessageCommands.RunnerStateChange, id);
1623
+ } else {
1624
+ console.warn(`#UpdateRunnerStateById(): Runner ID: [${id}] not found`);
1625
+ }
1626
+ } catch (error) {
1627
+ console.error(`#UpdateRunnerStateById(): [${error}]`);
1628
+ }
1608
1629
  });
1609
1630
  __privateAdd(this, _GetAllRunners, () => {
1610
1631
  return __privateGet(this, _runners);
1611
1632
  });
1633
+ // If an error occurs or the runner does not exist, treat as cannot execute next iteration
1612
1634
  __privateAdd(this, _CanExecuteNextIterationById, (id) => {
1613
- const state = __privateGet(this, _runners)[id].runner.state;
1614
- if (state === IRunnerState.running) {
1615
- return true;
1635
+ try {
1636
+ if (__privateGet(this, _runners)[id]) {
1637
+ const state = __privateGet(this, _runners)[id].runner.state;
1638
+ if (state === IRunnerState.running) {
1639
+ return true;
1640
+ }
1641
+ return false;
1642
+ } else {
1643
+ console.warn(`#CanExecuteNextIterationById(): Runner ID: [${id}] not found`);
1644
+ return false;
1645
+ }
1646
+ } catch (error) {
1647
+ console.error(`#CanExecuteNextIterationById(): [${error}]`);
1648
+ return false;
1616
1649
  }
1617
- return false;
1618
1650
  });
1651
+ // If an error occurs or the runner does not exist, treat as completed.
1619
1652
  __privateAdd(this, _IsCompletedById, (id) => {
1620
- const state = __privateGet(this, _runners)[id].runner.state;
1621
- if (state === IRunnerState.error || state === IRunnerState.completed || state === IRunnerState.stopped || state === IRunnerState.terminated) {
1653
+ try {
1654
+ if (__privateGet(this, _runners)[id]) {
1655
+ const state = __privateGet(this, _runners)[id].runner.state;
1656
+ if (state === IRunnerState.error || state === IRunnerState.completed || state === IRunnerState.stopped || state === IRunnerState.terminated) {
1657
+ return true;
1658
+ }
1659
+ return false;
1660
+ } else {
1661
+ console.warn(`#IsCompletedById(): Runner ID: [${id}] not found`);
1662
+ return true;
1663
+ }
1664
+ } catch (error) {
1665
+ console.error(`#IsCompletedById(): [${error}]`);
1622
1666
  return true;
1623
1667
  }
1624
- return false;
1625
1668
  });
1626
1669
  __privateAdd(this, _GetRunnerIterationById, (id) => {
1627
- return __privateGet(this, _runners)[id].runner.iteration;
1670
+ try {
1671
+ if (__privateGet(this, _runners)[id]) {
1672
+ return __privateGet(this, _runners)[id].runner.iteration;
1673
+ } else {
1674
+ console.warn(`#GetRunnerIterationById(): Runner ID: [${id}] not found`);
1675
+ return 0;
1676
+ }
1677
+ } catch (error) {
1678
+ console.error(`#GetRunnerIterationById(): [${error}]`);
1679
+ return 0;
1680
+ }
1628
1681
  });
1629
1682
  __privateAdd(this, _ResetRunnerIterationById, (id) => {
1630
- __privateGet(this, _runners)[id].runner.iteration = 0;
1631
- return 0;
1683
+ try {
1684
+ if (__privateGet(this, _runners)[id]) {
1685
+ __privateGet(this, _runners)[id].runner.iteration = 0;
1686
+ return 0;
1687
+ } else {
1688
+ console.warn(`#ResetRunnerIterationById(): Runner ID: [${id}] not found`);
1689
+ return 0;
1690
+ }
1691
+ } catch (error) {
1692
+ console.error(`#ResetRunnerIterationById(): [${error}]`);
1693
+ return 0;
1694
+ }
1632
1695
  });
1633
1696
  __privateAdd(this, _IncRunnerIterationById, (id) => {
1634
- __privateGet(this, _runners)[id].runner.iteration++;
1635
- return __privateGet(this, _runners)[id].runner.iteration;
1697
+ try {
1698
+ if (__privateGet(this, _runners)[id]) {
1699
+ __privateGet(this, _runners)[id].runner.iteration++;
1700
+ return __privateGet(this, _runners)[id].runner.iteration;
1701
+ } else {
1702
+ console.warn(`#IncRunnerIterationById(): Runner ID: [${id}] not found`);
1703
+ return 0;
1704
+ }
1705
+ } catch (error) {
1706
+ console.error(`#IncRunnerIterationById(): [${error}]`);
1707
+ return 0;
1708
+ }
1636
1709
  });
1637
1710
  __privateAdd(this, _GetRunnerInstanceById, (id) => {
1638
- return __privateGet(this, _runners)[id].runnerInstance;
1711
+ try {
1712
+ if (__privateGet(this, _runners)[id]) {
1713
+ return __privateGet(this, _runners)[id].runnerInstance;
1714
+ } else {
1715
+ console.warn(`#GetRunnerInstanceById(): Runner ID: [${id}] not found`);
1716
+ }
1717
+ } catch (error) {
1718
+ console.error(`#GetRunnerInstanceById(): [${error}]`);
1719
+ }
1639
1720
  });
1640
1721
  __privateAdd(this, _GetRunnerExecutionProfileById, (id) => {
1641
- return __privateGet(this, _runners)[id].runner.options.executionProfile;
1722
+ try {
1723
+ if (__privateGet(this, _runners)[id]) {
1724
+ return __privateGet(this, _runners)[id].runner.options.executionProfile;
1725
+ } else {
1726
+ console.warn(`#GetRunnerExecutionProfileById(): Runner ID: [${id}] not found`);
1727
+ }
1728
+ } catch (error) {
1729
+ console.error(`#GetRunnerExecutionProfileById(): [${error}]`);
1730
+ }
1642
1731
  });
1643
1732
  __privateAdd(this, _GetRunnerOptionsById, (id) => {
1644
- return __privateGet(this, _runners)[id].runner.options;
1733
+ try {
1734
+ if (__privateGet(this, _runners)[id]) {
1735
+ return __privateGet(this, _runners)[id].runner.options;
1736
+ } else {
1737
+ console.warn(`#GetRunnerOptionsById(): Runner ID: [${id}] not found`);
1738
+ }
1739
+ } catch (error) {
1740
+ console.error(`#GetRunnerOptionsById(): [${error}]`);
1741
+ }
1645
1742
  });
1646
1743
  __privateAdd(this, _SetRunnerOptionsById, (id, options) => {
1647
- __privateGet(this, _runners)[id].runner.options = { ...options };
1648
- return __privateGet(this, _runners)[id].runner.options;
1744
+ try {
1745
+ if (__privateGet(this, _runners)[id]) {
1746
+ __privateGet(this, _runners)[id].runner.options = { ...options };
1747
+ return __privateGet(this, _runners)[id].runner.options;
1748
+ } else {
1749
+ console.warn(`#SetRunnerOptionsById(): Runner ID: [${id}] not found`);
1750
+ }
1751
+ } catch (error) {
1752
+ console.error(`#SetRunnerOptionsById(): [${error}]`);
1753
+ }
1649
1754
  });
1650
1755
  __privateAdd(this, _AddRunner, (testRunnerTelemetryPayload) => {
1651
- __privateGet(this, _debug).call(this, `AddRunner`);
1652
- const { runner } = testRunnerTelemetryPayload;
1653
- const asyncRunnerInstance = this.CreateAsyncRunner(testRunnerTelemetryPayload);
1654
- if (asyncRunnerInstance) {
1655
- __privateGet(this, _CreateRunnerEx2RunState).call(this, runner, asyncRunnerInstance);
1756
+ try {
1757
+ const { runner } = testRunnerTelemetryPayload;
1758
+ const asyncRunnerInstance = this.CreateAsyncRunner(testRunnerTelemetryPayload);
1759
+ if (asyncRunnerInstance) {
1760
+ __privateGet(this, _CreateRunnerEx2RunState).call(this, runner, asyncRunnerInstance);
1761
+ } else {
1762
+ console.warn(`#AddRunner(): CreateAsyncRunner not defined.`);
1763
+ }
1764
+ return runner;
1765
+ } catch (error) {
1766
+ console.error(`#AddRunner(): [${error}]`);
1656
1767
  }
1657
- return runner;
1658
1768
  });
1659
1769
  __privateAdd(this, _PostMessageToWorkerManagerById, async (command, id) => {
1660
- if (__privateGet(this, _collectorCollectorPort)) {
1661
- if (__privateGet(this, _runners)[id]) {
1662
- const message = {
1663
- command,
1664
- payload: {
1665
- runner: __privateGet(this, _runners)[id].runner
1666
- }
1667
- };
1668
- __privateGet(this, _collectorCollectorPort).postMessage(message);
1669
- await stsutils.Sleep(0);
1770
+ try {
1771
+ if (__privateGet(this, _collectorCollectorPort)) {
1772
+ if (__privateGet(this, _runners)[id]) {
1773
+ const message = {
1774
+ command,
1775
+ payload: {
1776
+ runner: __privateGet(this, _runners)[id].runner
1777
+ }
1778
+ };
1779
+ __privateGet(this, _collectorCollectorPort).postMessage(message);
1780
+ await stsutils.Sleep(0);
1781
+ }
1670
1782
  }
1783
+ } catch (error) {
1784
+ console.error(`#PostMessageToWorkerManagerById(): [${error}]`);
1671
1785
  }
1672
1786
  });
1673
1787
  __privateAdd(this, _StartRunner, async (testRunnerTelemetryPayload) => {
1674
- const runnerId = testRunnerTelemetryPayload.runner.id;
1675
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} StartRunner`);
1676
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).StartRunner();
1677
- __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
1678
- const startLoop = /* @__PURE__ */ new Date();
1679
- const ExecuteLoop = async () => {
1680
- let cont = true;
1681
- const { iterations, duration, delayBetweenIterations } = __privateGet(this, _GetRunnerExecutionProfileById).call(this, runnerId);
1682
- if (iterations > 0) {
1683
- cont = __privateGet(this, _GetRunnerIterationById).call(this, runnerId) < iterations;
1684
- } else if (duration > 0) {
1685
- cont = ((/* @__PURE__ */ new Date()).getTime() - startLoop.getTime()) / 1e3 < duration;
1686
- }
1687
- if (cont) {
1688
- if (__privateGet(this, _CanExecuteNextIterationById).call(this, runnerId)) {
1689
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).Execute(__privateGet(this, _GetRunnerIterationById).call(this, runnerId));
1690
- __privateGet(this, _IncRunnerIterationById).call(this, runnerId);
1691
- }
1692
- if (__privateGet(this, _CanExecuteNextIterationById).call(this, runnerId)) {
1693
- if (delayBetweenIterations > 0) {
1694
- await stsutils.Sleep(delayBetweenIterations);
1788
+ var _a;
1789
+ try {
1790
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1791
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} StartRunner`);
1792
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.StartRunner());
1793
+ __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
1794
+ const startLoop = /* @__PURE__ */ new Date();
1795
+ const ExecuteLoop = async () => {
1796
+ var _a2, _b;
1797
+ try {
1798
+ let cont = true;
1799
+ const executionProfile = __privateGet(this, _GetRunnerExecutionProfileById).call(this, runnerId);
1800
+ if (executionProfile) {
1801
+ const { iterations, duration, delayBetweenIterations } = executionProfile;
1802
+ if (iterations > 0) {
1803
+ cont = __privateGet(this, _GetRunnerIterationById).call(this, runnerId) < iterations;
1804
+ } else if (duration > 0) {
1805
+ cont = ((/* @__PURE__ */ new Date()).getTime() - startLoop.getTime()) / 1e3 < duration;
1806
+ }
1807
+ if (cont) {
1808
+ if (__privateGet(this, _CanExecuteNextIterationById).call(this, runnerId)) {
1809
+ await ((_a2 = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a2.Execute(__privateGet(this, _GetRunnerIterationById).call(this, runnerId)));
1810
+ if (!__privateGet(this, _IsCompletedById).call(this, runnerId)) {
1811
+ __privateGet(this, _IncRunnerIterationById).call(this, runnerId);
1812
+ }
1813
+ }
1814
+ if (__privateGet(this, _CanExecuteNextIterationById).call(this, runnerId)) {
1815
+ if (delayBetweenIterations > 0) {
1816
+ await stsutils.Sleep(delayBetweenIterations);
1817
+ } else {
1818
+ await __privateMethod(this, _WorkerInstance_instances, SleepImmediate_fn).call(this);
1819
+ }
1820
+ ExecuteLoop();
1821
+ } else {
1822
+ if (!__privateGet(this, _IsCompletedById).call(this, runnerId)) {
1823
+ await stsutils.Sleep(50);
1824
+ ExecuteLoop();
1825
+ }
1826
+ }
1827
+ } else {
1828
+ await ((_b = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _b.Completed());
1829
+ __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.completed);
1830
+ }
1695
1831
  } else {
1696
- await __privateMethod(this, _WorkerInstance_instances, SleepImmediate_fn).call(this);
1697
- }
1698
- ExecuteLoop();
1699
- } else {
1700
- if (!__privateGet(this, _IsCompletedById).call(this, runnerId)) {
1701
- await stsutils.Sleep(50);
1702
- ExecuteLoop();
1832
+ console.warn(`#StartRunner:ExecuteLoop(): Cannot get execution profile for runner: [${runnerId}]`);
1703
1833
  }
1834
+ } catch (error) {
1835
+ console.error(`#StartRunner:ExecuteLoop(): Error: [${error}]`);
1704
1836
  }
1705
- } else {
1706
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).Completed();
1707
- __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.completed);
1708
- }
1709
- };
1710
- ExecuteLoop();
1837
+ };
1838
+ ExecuteLoop();
1839
+ } catch (error) {
1840
+ console.error(`#StartRunner(): Error: [${error}]`);
1841
+ }
1711
1842
  });
1712
- __privateAdd(this, _StopRunnerByRunnerById, async (id) => {
1713
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${id}]`)} StopRunner`);
1714
- await __privateGet(this, _GetRunnerInstanceById).call(this, id).StopRunner();
1715
- await __privateGet(this, _UpdateRunnerStateById).call(this, id, IRunnerState.stopped);
1843
+ __privateAdd(this, _StopRunnerByRunnerId, async (id) => {
1844
+ var _a;
1845
+ try {
1846
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${id}]`)} StopRunner`);
1847
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, id)) == null ? void 0 : _a.StopRunner());
1848
+ await __privateGet(this, _UpdateRunnerStateById).call(this, id, IRunnerState.stopped);
1849
+ } catch (error) {
1850
+ console.error(`#StopRunnerByRunnerId(): Error: [${error}]`);
1851
+ }
1716
1852
  });
1717
1853
  __privateAdd(this, _StopAllRunners, async (testRunnerTelemetryPayload) => {
1718
- __privateGet(this, _debug).call(this, `StopAllRunners`);
1719
- const promArray = [];
1720
- for (const [, runner] of Object.entries(__privateGet(this, _GetAllRunners))) {
1721
- promArray.push(__privateGet(this, _StopRunnerByRunnerById).call(this, runner.id));
1854
+ try {
1855
+ __privateGet(this, _debug).call(this, `StopAllRunners`);
1856
+ const promArray = [];
1857
+ for (const [, runner] of Object.entries(__privateGet(this, _GetAllRunners))) {
1858
+ promArray.push(__privateGet(this, _StopRunnerByRunnerId).call(this, runner.id));
1859
+ }
1860
+ await Promise.all(promArray);
1861
+ await stsutils.Sleep(0);
1862
+ } catch (error) {
1863
+ console.error(`#StopAllRunners(): Error: [${error}]`);
1722
1864
  }
1723
- await Promise.all(promArray);
1724
- await stsutils.Sleep(0);
1725
1865
  });
1726
1866
  __privateAdd(this, _StopRunner, async (testRunnerTelemetryPayload) => {
1727
- await __privateGet(this, _StopRunnerByRunnerById).call(this, testRunnerTelemetryPayload.runner.id);
1867
+ try {
1868
+ await __privateGet(this, _StopRunnerByRunnerId).call(this, testRunnerTelemetryPayload.runner.id);
1869
+ } catch (error) {
1870
+ console.error(`#StopRunner(): Error: [${error}]`);
1871
+ }
1728
1872
  });
1729
1873
  __privateAdd(this, _TerminateRunner, async (testRunnerTelemetryPayload) => {
1730
- const runnerId = testRunnerTelemetryPayload.runner.id;
1731
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} TerminateRunner`);
1732
- const retVal = await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).TerminateRunner();
1733
- await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.terminated);
1734
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} TerminateRunner Result = [${retVal}]`);
1874
+ var _a;
1875
+ try {
1876
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1877
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} TerminateRunner`);
1878
+ const retVal = await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.TerminateRunner());
1879
+ await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.terminated);
1880
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} TerminateRunner Result = [${retVal}]`);
1881
+ } catch (error) {
1882
+ console.error(`#TerminateRunner(): Error: [${error}]`);
1883
+ }
1735
1884
  });
1736
1885
  __privateAdd(this, _PauseRunner, async (testRunnerTelemetryPayload) => {
1737
- const runnerId = testRunnerTelemetryPayload.runner.id;
1738
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} PauseRunner`);
1739
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).PauseRunner();
1740
- await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1886
+ var _a;
1887
+ try {
1888
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1889
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} PauseRunner`);
1890
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.PauseRunner());
1891
+ await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1892
+ } catch (error) {
1893
+ console.error(`#PauseRunner(): Error: [${error}]`);
1894
+ }
1741
1895
  });
1742
1896
  __privateAdd(this, _ResumeRunner, async (testRunnerTelemetryPayload) => {
1743
- const runnerId = testRunnerTelemetryPayload.runner.id;
1744
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ResumeRunner`);
1745
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).ResumeRunner();
1746
- await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
1897
+ var _a;
1898
+ try {
1899
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1900
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ResumeRunner`);
1901
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.ResumeRunner());
1902
+ await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.running);
1903
+ } catch (error) {
1904
+ console.error(`#ResumeRunner(): Error: [${error}]`);
1905
+ }
1747
1906
  });
1748
1907
  __privateAdd(this, _ResetRunner, async (testRunnerTelemetryPayload) => {
1749
- const runnerId = testRunnerTelemetryPayload.runner.id;
1750
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ResetRunner`);
1751
- __privateGet(this, _ResetRunnerIterationById).call(this, runnerId);
1752
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).ResetRunner();
1753
- await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1908
+ var _a;
1909
+ try {
1910
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1911
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ResetRunner`);
1912
+ __privateGet(this, _ResetRunnerIterationById).call(this, runnerId);
1913
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.ResetRunner());
1914
+ await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1915
+ } catch (error) {
1916
+ console.error(`#ResetRunner(): Error: [${error}]`);
1917
+ }
1754
1918
  });
1755
1919
  // Execute a single iteration of this runners work item
1756
1920
  __privateAdd(this, _ExecuteRunner, async (testRunnerTelemetryPayload) => {
1757
- const runnerId = testRunnerTelemetryPayload.runner.id;
1758
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ExecuteRunner`);
1759
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).Execute(__privateGet(this, _GetRunnerIterationById).call(this, runnerId));
1760
- __privateGet(this, _IncRunnerIterationById).call(this, runnerId);
1761
- await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1921
+ var _a;
1922
+ try {
1923
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1924
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} ExecuteRunner`);
1925
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.Execute(__privateGet(this, _GetRunnerIterationById).call(this, runnerId)));
1926
+ __privateGet(this, _IncRunnerIterationById).call(this, runnerId);
1927
+ await __privateGet(this, _UpdateRunnerStateById).call(this, runnerId, IRunnerState.paused);
1928
+ } catch (error) {
1929
+ console.error(`#ExecuteRunner(): Error: [${error}]`);
1930
+ }
1762
1931
  });
1763
1932
  __privateAdd(this, _UpdateOptions, async (testRunnerTelemetryPayload) => {
1764
- const runnerId = testRunnerTelemetryPayload.runner.id;
1765
- __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} UpdateOptions`);
1766
- __privateGet(this, _debug).call(this, chalk.cyan(`before: [${JSON.stringify(__privateGet(this, _GetRunnerOptionsById).call(this, runnerId))}]`));
1767
- __privateGet(this, _SetRunnerOptionsById).call(this, runnerId, testRunnerTelemetryPayload.runner.options);
1768
- __privateGet(this, _debug).call(this, chalk.cyan(`after: [${JSON.stringify(__privateGet(this, _GetRunnerOptionsById).call(this, runnerId))}]`));
1769
- await __privateGet(this, _GetRunnerInstanceById).call(this, runnerId).UpdateOptions();
1770
- await stsutils.Sleep(0);
1933
+ var _a;
1934
+ try {
1935
+ const runnerId = testRunnerTelemetryPayload.runner.id;
1936
+ __privateGet(this, _debug).call(this, `${chalk.magenta(`runner: [${runnerId}]`)} UpdateOptions`);
1937
+ __privateGet(this, _debug).call(this, chalk.cyan(`before: [${JSON.stringify(__privateGet(this, _GetRunnerOptionsById).call(this, runnerId))}]`));
1938
+ __privateGet(this, _SetRunnerOptionsById).call(this, runnerId, testRunnerTelemetryPayload.runner.options);
1939
+ __privateGet(this, _debug).call(this, chalk.cyan(`after: [${JSON.stringify(__privateGet(this, _GetRunnerOptionsById).call(this, runnerId))}]`));
1940
+ await ((_a = __privateGet(this, _GetRunnerInstanceById).call(this, runnerId)) == null ? void 0 : _a.UpdateOptions());
1941
+ await stsutils.Sleep(0);
1942
+ } catch (error) {
1943
+ console.error(`#UpdateOptions(): Error: [${error}]`);
1944
+ }
1771
1945
  });
1772
1946
  // ProcessMessage = async(data: MessageEvent) => { // Browser version
1773
1947
  __publicField(this, "ProcessMessage", async (data) => {
@@ -1826,6 +2000,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1826
2000
  __privateGet(this, _debug).call(this, `Invalid payloadMessage.command: [${payloadMessage.command}] - Ignoring`);
1827
2001
  }
1828
2002
  } catch (error) {
2003
+ console.error(`ProcessMessage(): Error: [${error}]`);
1829
2004
  __privateGet(this, _error).call(this, error);
1830
2005
  }
1831
2006
  });
@@ -1868,7 +2043,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
1868
2043
  };
1869
2044
  _PostMessageToWorkerManagerById = new WeakMap();
1870
2045
  _StartRunner = new WeakMap();
1871
- _StopRunnerByRunnerById = new WeakMap();
2046
+ _StopRunnerByRunnerId = new WeakMap();
1872
2047
  _StopAllRunners = new WeakMap();
1873
2048
  _StopRunner = new WeakMap();
1874
2049
  _TerminateRunner = new WeakMap();
@@ -2108,6 +2283,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2108
2283
  id: workerId,
2109
2284
  workerManagerId: __privateGet(this, _id),
2110
2285
  worker: workerFactory.createWorkerThreadWorker(),
2286
+ workerEvents: [],
2111
2287
  messagePort: port1,
2112
2288
  options: workerOptions,
2113
2289
  runnersEx: {},
@@ -2131,7 +2307,14 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2131
2307
  Terminate: () => __privateGet(this, _TerminateWorker).call(this, stsWorkerEx),
2132
2308
  Reset: () => __privateGet(this, _ResetWorker).call(this, stsWorkerEx),
2133
2309
  Execute: () => __privateGet(this, _ExecuteWorker).call(this, stsWorkerEx),
2134
- UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile)
2310
+ UpdateOptions: (executionProfile) => __privateGet(this, _UpdateOptionsWorker).call(this, stsWorkerEx, executionProfile),
2311
+ on: (eventName, cb) => {
2312
+ stsWorkerEx.workerEvents.push({
2313
+ eventName,
2314
+ cb
2315
+ });
2316
+ return stsWorkerEx;
2317
+ }
2135
2318
  };
2136
2319
  if (__privateGet(this, _STSInstrumentController)) {
2137
2320
  __privateGet(this, _STSInstrumentController).LogEx(chalk.yellow(`pid: [${process.pid}] Creating new worker: [${stsWorkerEx.id}]`));
@@ -2162,17 +2345,45 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2162
2345
  if (!stsWorkerEx.options.mocked) {
2163
2346
  if (isNode) {
2164
2347
  stsWorkerEx.worker.on("exit", (code) => {
2165
- console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker exited with code: ${code}`));
2348
+ try {
2349
+ console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker exited with code: ${code}`));
2350
+ __privateGet(this, _EmitWorkerEvent).call(this, "exit", stsWorkerEx);
2351
+ if (__privateGet(this, _workersEx)[stsWorkerEx.id]) {
2352
+ delete __privateGet(this, _workersEx)[stsWorkerEx.id];
2353
+ console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${stsWorkerEx.id}] has been removed from the worker collection.`));
2354
+ }
2355
+ } catch (error) {
2356
+ console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(exit): Error: [${error}] Worker: [${stsWorkerEx.id}]`));
2357
+ }
2166
2358
  });
2167
2359
  stsWorkerEx.worker.on("error", (error) => {
2168
- console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(error): Worker error: ${error}`));
2360
+ try {
2361
+ console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(error): Worker error: ${error}`));
2362
+ __privateGet(this, _EmitWorkerEvent).call(this, "error", stsWorkerEx);
2363
+ } catch (error2) {
2364
+ console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.on(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
2365
+ }
2169
2366
  });
2170
2367
  } else {
2171
2368
  stsWorkerEx.worker.onerror = (error) => {
2172
- console.error(chalk.red("STSWorkerManager:stsWorkerEx.worker.onerror(): Error in worker:", error));
2369
+ try {
2370
+ console.error(chalk.red("STSWorkerManager:stsWorkerEx.worker.onerror(): Error in worker:", error));
2371
+ __privateGet(this, _EmitWorkerEvent).call(this, "onerror", stsWorkerEx);
2372
+ if (__privateGet(this, _workersEx)[stsWorkerEx.id]) {
2373
+ delete __privateGet(this, _workersEx)[stsWorkerEx.id];
2374
+ console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.onerror(error): Worker: [${stsWorkerEx.id}] has been removed from the worker collection.`));
2375
+ }
2376
+ } catch (error2) {
2377
+ console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.onerror(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
2378
+ }
2173
2379
  };
2174
2380
  stsWorkerEx.worker.onmessageerror = (error) => {
2175
- console.error(chalk.red("STSWorkerManager:stsWorkerEx.worker.onmessageerror(): Message error in worker:", error));
2381
+ try {
2382
+ console.error(chalk.red("STSWorkerManager:stsWorkerEx.worker.onmessageerror(): Message error in worker:", error));
2383
+ __privateGet(this, _EmitWorkerEvent).call(this, "onmessageerror", stsWorkerEx);
2384
+ } catch (error2) {
2385
+ console.error(chalk.red(`STSWorkerManager:stsWorkerEx.worker.onmessageerror(error): Error: [${error2}] Worker: [${stsWorkerEx.id}]`));
2386
+ }
2176
2387
  };
2177
2388
  }
2178
2389
  }
@@ -2241,10 +2452,17 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2241
2452
  if (runnerEx.publishInstrumentController && __privateGet(this, _telemetryProcessor)) {
2242
2453
  __privateGet(this, _telemetryProcessor).ProcessTelemetry(runnerEx.publishInstrumentController, runnerEx.instrumentData);
2243
2454
  }
2244
- __privateGet(this, _EmitEvent).call(this, "Telemetry", workerEx, runner.id);
2455
+ __privateGet(this, _EmitRunnerEvent).call(this, "Telemetry", workerEx, runner.id);
2245
2456
  }
2246
2457
  });
2247
- __privateAdd(this, _EmitEvent, (eventName, workerEx, runnerId) => {
2458
+ __privateAdd(this, _EmitWorkerEvent, (eventName, workerEx) => {
2459
+ workerEx.workerEvents.forEach((ev) => {
2460
+ if (ev.eventName.localeCompare(eventName) === 0) {
2461
+ ev.cb(workerEx);
2462
+ }
2463
+ });
2464
+ });
2465
+ __privateAdd(this, _EmitRunnerEvent, (eventName, workerEx, runnerId) => {
2248
2466
  if (workerEx.runnersEvents[runnerId]) {
2249
2467
  const runnersEvents = workerEx.runnersEvents[runnerId];
2250
2468
  runnersEvents.forEach((ev) => {
@@ -2269,7 +2487,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2269
2487
  eventDate: /* @__PURE__ */ new Date(),
2270
2488
  runner: { ...runner }
2271
2489
  });
2272
- __privateGet(this, _EmitEvent).call(this, "StateChange", workerEx, runner.id);
2490
+ __privateGet(this, _EmitRunnerEvent).call(this, "StateChange", workerEx, runner.id);
2273
2491
  }
2274
2492
  });
2275
2493
  __privateAdd(this, _RemoveRunnerFromCollection, (workerEx, payloadContents) => {
@@ -2474,6 +2692,24 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2474
2692
  __privateAdd(this, _UpdateOptionsWorker, (workerEx, executionProfile) => {
2475
2693
  return __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _UpdateOptionsRunner), executionProfile);
2476
2694
  });
2695
+ __privateAdd(this, _TerminateWorker, (workerEx) => {
2696
+ try {
2697
+ const retVal = __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
2698
+ if (workerEx.worker) {
2699
+ workerEx.worker.terminate();
2700
+ __privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
2701
+ if (__privateGet(this, _workersEx)[workerEx.id]) {
2702
+ delete __privateGet(this, _workersEx)[workerEx.id];
2703
+ console.log(chalk.magenta(`STSWorkerManager:stsWorkerEx.worker.on(exit): Worker: [${workerEx.id}] has been removed from the worker collection.`));
2704
+ }
2705
+ } else {
2706
+ }
2707
+ return retVal;
2708
+ } catch (error) {
2709
+ console.log(`Error in STSTestWorker:TerminateWorker: [${error}]`);
2710
+ return [];
2711
+ }
2712
+ });
2477
2713
  __privateAdd(this, _BroadcastCommandToAllRunners, (workerEx, command, executionProfile) => {
2478
2714
  try {
2479
2715
  const executeCommand = (runnerEx) => {
@@ -2491,21 +2727,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2491
2727
  return [];
2492
2728
  }
2493
2729
  });
2494
- __privateAdd(this, _TerminateWorker, (workerEx) => {
2495
- try {
2496
- const retVal = __privateGet(this, _BroadcastCommandToAllRunners).call(this, workerEx, __privateGet(this, _TerminateRunner2));
2497
- if (workerEx.worker) {
2498
- workerEx.worker.terminate();
2499
- __privateGet(this, _debug2).call(this, `Terminated worker: [${workerEx.id}]`);
2500
- delete __privateGet(this, _workersEx)[workerEx.id];
2501
- } else {
2502
- }
2503
- return retVal;
2504
- } catch (error) {
2505
- console.log(`Error in STSTestWorker:TerminateWorker: [${error}]`);
2506
- return [];
2507
- }
2508
- });
2509
2730
  __publicField(this, "GetNextAvailableWorker", () => {
2510
2731
  let leastRunnerWorker = null;
2511
2732
  for (const [, stsWorker] of Object.entries(this.WorkersEx)) {
@@ -2642,7 +2863,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2642
2863
  _debug2 = new WeakMap();
2643
2864
  _SetRunnerIntoWorker = new WeakMap();
2644
2865
  _ProcessTelemetry = new WeakMap();
2645
- _EmitEvent = new WeakMap();
2866
+ _EmitWorkerEvent = new WeakMap();
2867
+ _EmitRunnerEvent = new WeakMap();
2646
2868
  _RunnerStateChange = new WeakMap();
2647
2869
  _RemoveRunnerFromCollection = new WeakMap();
2648
2870
  _CreateAsyncRunner = new WeakMap();
@@ -2663,8 +2885,8 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
2663
2885
  _ResetWorker = new WeakMap();
2664
2886
  _ExecuteWorker = new WeakMap();
2665
2887
  _UpdateOptionsWorker = new WeakMap();
2666
- _BroadcastCommandToAllRunners = new WeakMap();
2667
2888
  _TerminateWorker = new WeakMap();
2889
+ _BroadcastCommandToAllRunners = new WeakMap();
2668
2890
  _HandleAllWorkers = new WeakMap();
2669
2891
  exports2.IRunnerState = IRunnerState;
2670
2892
  exports2.IWorkerState = IWorkerState;