@cadenza.io/core 3.15.11 → 3.15.13

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.mjs CHANGED
@@ -411,7 +411,7 @@ var SignalBroker = class _SignalBroker {
411
411
  * @param startDateTime Optional absolute Date when the *first* emission after `leading` should occur.
412
412
  * @returns a handle with `clear()` to stop the loop.
413
413
  */
414
- throttle(signal, context, intervalMs = 6e4, leading = false, startDateTime) {
414
+ interval(signal, context, intervalMs = 6e4, leading = false, startDateTime) {
415
415
  if (intervalMs <= 0) {
416
416
  throw new Error("intervalMs must be a positive number");
417
417
  }
@@ -1739,7 +1739,7 @@ var GraphNode = class _GraphNode extends SignalEmitter {
1739
1739
  generateNewNodes(result) {
1740
1740
  const groupId = uuid4();
1741
1741
  const newNodes = [];
1742
- if (typeof result !== "boolean") {
1742
+ if (result && typeof result !== "boolean") {
1743
1743
  this.failed = result.failed !== void 0 && result.failed || result.error !== void 0;
1744
1744
  if (!this.failed) {
1745
1745
  newNodes.push(
@@ -1999,6 +1999,7 @@ var GraphRoutine = class extends SignalEmitter {
1999
1999
  this.isMeta = false;
2000
2000
  this.tasks = /* @__PURE__ */ new Set();
2001
2001
  this.registered = false;
2002
+ this.registeredTasks = /* @__PURE__ */ new Set();
2002
2003
  this.observedSignals = /* @__PURE__ */ new Set();
2003
2004
  this.name = name;
2004
2005
  this.description = description;
@@ -4469,8 +4470,8 @@ var Cadenza = class {
4469
4470
  static schedule(taskName, context, timeoutMs, exactDateTime) {
4470
4471
  this.broker?.schedule(taskName, context, timeoutMs, exactDateTime);
4471
4472
  }
4472
- static throttle(taskName, context, intervalMs, leading = false, startDateTime) {
4473
- this.broker?.throttle(
4473
+ static interval(taskName, context, intervalMs, leading = false, startDateTime) {
4474
+ this.broker?.interval(
4474
4475
  taskName,
4475
4476
  context,
4476
4477
  intervalMs,
@@ -4484,6 +4485,9 @@ var Cadenza = class {
4484
4485
  static get(taskName) {
4485
4486
  return this.registry?.tasks.get(taskName);
4486
4487
  }
4488
+ static getRoutine(routineName) {
4489
+ return this.registry?.routines.get(routineName);
4490
+ }
4487
4491
  /**
4488
4492
  * Creates and registers a new task with the specified parameters and options.
4489
4493
  * Tasks are the basic building blocks of Cadenza graphs and are responsible for executing logic.