@dudousxd/nestjs-durable-core 0.97.0 → 0.98.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.cts CHANGED
@@ -3296,6 +3296,20 @@ interface GroupHealth {
3296
3296
  * leaking the raw queue count.
3297
3297
  */
3298
3298
  kind?: 'workflow' | 'step';
3299
+ /**
3300
+ * The broker queue the group's tasks wait on, when it is shared with other groups (the BullMQ
3301
+ * transport's `taskQueues: 'grouped'`). Absent when the group has a queue of its own.
3302
+ */
3303
+ queue?: string;
3304
+ /** The shared {@link queue}'s depth across every group on it. */
3305
+ queueDepth?: number;
3306
+ /** `depth` was counted from a sample of the shared queue's jobs and may undercount. */
3307
+ depthSampled?: boolean;
3308
+ /**
3309
+ * The part of `depth` still waiting on the group's own (per-handler) queue while it is drained
3310
+ * after a switch to a shared {@link queue}. Not part of `queueDepth`.
3311
+ */
3312
+ drainingDepth?: number;
3299
3313
  }
3300
3314
  /**
3301
3315
  * The **control plane** — a broadcast pub/sub across ALL engine instances (every pod), separate
package/dist/index.d.ts CHANGED
@@ -3296,6 +3296,20 @@ interface GroupHealth {
3296
3296
  * leaking the raw queue count.
3297
3297
  */
3298
3298
  kind?: 'workflow' | 'step';
3299
+ /**
3300
+ * The broker queue the group's tasks wait on, when it is shared with other groups (the BullMQ
3301
+ * transport's `taskQueues: 'grouped'`). Absent when the group has a queue of its own.
3302
+ */
3303
+ queue?: string;
3304
+ /** The shared {@link queue}'s depth across every group on it. */
3305
+ queueDepth?: number;
3306
+ /** `depth` was counted from a sample of the shared queue's jobs and may undercount. */
3307
+ depthSampled?: boolean;
3308
+ /**
3309
+ * The part of `depth` still waiting on the group's own (per-handler) queue while it is drained
3310
+ * after a switch to a shared {@link queue}. Not part of `queueDepth`.
3311
+ */
3312
+ drainingDepth?: number;
3299
3313
  }
3300
3314
  /**
3301
3315
  * The **control plane** — a broadcast pub/sub across ALL engine instances (every pod), separate
package/dist/index.js CHANGED
@@ -5007,10 +5007,24 @@ var TransportPool = class {
5007
5007
  if (transport.groupHealth) reports.push(await transport.groupHealth(group));
5008
5008
  }
5009
5009
  if (reports.length === 0) return void 0;
5010
+ const shared = reports.find((r) => r.queue !== void 0);
5011
+ const draining = reports.reduce((sum, r) => sum + (r.drainingDepth ?? 0), 0);
5010
5012
  return {
5011
5013
  group,
5012
5014
  depth: reports.reduce((sum, r) => sum + r.depth, 0),
5013
- liveWorkers: reports.flatMap((r) => r.liveWorkers)
5015
+ liveWorkers: reports.flatMap((r) => r.liveWorkers),
5016
+ ...shared?.queue !== void 0 ? {
5017
+ queue: shared.queue
5018
+ } : {},
5019
+ ...shared?.queueDepth !== void 0 ? {
5020
+ queueDepth: shared.queueDepth
5021
+ } : {},
5022
+ ...reports.some((r) => r.depthSampled) ? {
5023
+ depthSampled: true
5024
+ } : {},
5025
+ ...draining > 0 ? {
5026
+ drainingDepth: draining
5027
+ } : {}
5014
5028
  };
5015
5029
  }
5016
5030
  /**