@nsshunt/stsrunnerframework 2.0.18 → 2.0.20

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/index.cjs CHANGED
@@ -6337,6 +6337,17 @@ var STSWorkerManager = class {
6337
6337
  throw error;
6338
6338
  }
6339
6339
  };
6340
+ AddRunnerToWorkerByWorkerId = async (workerId, runnerOptions) => {
6341
+ this.#debug(`AddRunnerToWorkerByWorkerId()`);
6342
+ try {
6343
+ const stsWorkerEx = this.#workerRegistry.GetWorkerEx(workerId);
6344
+ if (stsWorkerEx) {} else throw new Error(`AddRunnerToWorkerByWorkerId(): Error: [Could not GetWorkerEx from workerId: [${workerId}]]`);
6345
+ return this.AddRunnerToWorker(stsWorkerEx, runnerOptions);
6346
+ } catch (error) {
6347
+ this.#error(`AddRunnerToWorkerByWorkerId(): Error: [${error}]`);
6348
+ throw error;
6349
+ }
6350
+ };
6340
6351
  /**
6341
6352
  * Get the current worker-manager options object.
6342
6353
  *
@@ -6557,6 +6568,20 @@ var STSWorkerManager = class {
6557
6568
  GetWorkersCore = async (states) => {
6558
6569
  return this.#workerStateSynchroniser.GetSyncedWorkersCore(states);
6559
6570
  };
6571
+ AddRunner = async (runnerOptions) => {
6572
+ this.#debug(`AddRunner()`);
6573
+ try {
6574
+ const stsWorkerEx = this.GetNextAvailableWorker();
6575
+ if (stsWorkerEx) return this.AddRunnerToWorker(stsWorkerEx, runnerOptions);
6576
+ else throw new Error(`AddRunner(): Error: [Could not get GetNextAvailableWorker()]`);
6577
+ } catch (error) {
6578
+ this.#error(`AddRunner(): Error: [${error}]`);
6579
+ throw error;
6580
+ }
6581
+ };
6582
+ GetNextAvailableWorker = () => {
6583
+ return this.#workerRegistry.GetNextAvailableWorker();
6584
+ };
6560
6585
  };
6561
6586
  //#endregion
6562
6587
  exports.AbstractRunnerExecutionWorker = AbstractRunnerExecutionWorker;