@cadenza.io/core 3.3.0 → 3.4.0

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.d.mts CHANGED
@@ -381,6 +381,7 @@ declare class Task extends SignalEmitter implements Graph {
381
381
  predecessorTasks: Set<Task>;
382
382
  destroyed: boolean;
383
383
  register: boolean;
384
+ registered: boolean;
384
385
  emitsSignals: Set<string>;
385
386
  signalsToEmitAfter: Set<string>;
386
387
  signalsToEmitOnFail: Set<string>;
@@ -827,6 +828,8 @@ declare class Cadenza {
827
828
  * @throws Error if invalid.
828
829
  */
829
830
  static validateName(name: string): void;
831
+ static runTask(task: Task, context: AnyObject): void;
832
+ static runRoutine(routine: GraphRoutine, context: AnyObject): void;
830
833
  /**
831
834
  * Creates a standard Task and registers it in the GraphRegistry.
832
835
  * @param name Unique identifier for the task.
package/dist/index.d.ts CHANGED
@@ -381,6 +381,7 @@ declare class Task extends SignalEmitter implements Graph {
381
381
  predecessorTasks: Set<Task>;
382
382
  destroyed: boolean;
383
383
  register: boolean;
384
+ registered: boolean;
384
385
  emitsSignals: Set<string>;
385
386
  signalsToEmitAfter: Set<string>;
386
387
  signalsToEmitOnFail: Set<string>;
@@ -827,6 +828,8 @@ declare class Cadenza {
827
828
  * @throws Error if invalid.
828
829
  */
829
830
  static validateName(name: string): void;
831
+ static runTask(task: Task, context: AnyObject): void;
832
+ static runRoutine(routine: GraphRoutine, context: AnyObject): void;
830
833
  /**
831
834
  * Creates a standard Task and registers it in the GraphRegistry.
832
835
  * @param name Unique identifier for the task.
package/dist/index.js CHANGED
@@ -1107,7 +1107,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
1107
1107
  this.retries++;
1108
1108
  await sleep(this.retryDelay);
1109
1109
  this.retryDelay *= this.task.retryDelayFactor;
1110
- if (this.retryDelay > this.task.retryDelayMax) {
1110
+ if (this.task.retryDelayMax > 0 && this.retryDelay > this.task.retryDelayMax) {
1111
1111
  this.retryDelay = this.task.retryDelayMax;
1112
1112
  }
1113
1113
  }
@@ -1551,6 +1551,7 @@ var Task = class extends SignalEmitter {
1551
1551
  this.predecessorTasks = /* @__PURE__ */ new Set();
1552
1552
  this.destroyed = false;
1553
1553
  this.register = true;
1554
+ this.registered = false;
1554
1555
  this.emitsSignals = /* @__PURE__ */ new Set();
1555
1556
  this.signalsToEmitAfter = /* @__PURE__ */ new Set();
1556
1557
  this.signalsToEmitOnFail = /* @__PURE__ */ new Set();
@@ -3226,6 +3227,12 @@ var Cadenza = class {
3226
3227
  throw new Error("Task or Routine name must be a non-empty string.");
3227
3228
  }
3228
3229
  }
3230
+ static runTask(task, context) {
3231
+ this.runner.run(task, context);
3232
+ }
3233
+ static runRoutine(routine, context) {
3234
+ this.runner.run(routine, context);
3235
+ }
3229
3236
  /**
3230
3237
  * Creates a standard Task and registers it in the GraphRegistry.
3231
3238
  * @param name Unique identifier for the task.