mailery 0.3.1 → 0.3.2

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.
@@ -339,6 +339,10 @@ interface QueueAPI {
339
339
  add(name: string, data: unknown, opts?: AddOptions): Promise<unknown>;
340
340
  /** Approximate count of jobs eligible-but-not-running. Used by broadcast backpressure. */
341
341
  getWaitingCount(): Promise<number>;
342
+ /** Active + waiting jobs (runnable now). Returns null when the driver can't expose it. */
343
+ getInFlightCount?(): Promise<number | null>;
344
+ /** Delayed jobs scheduled for the future. Returns null when unsupported. */
345
+ getDelayedCount?(): Promise<number | null>;
342
346
  close(): Promise<void>;
343
347
  }
344
348
  interface Queues {
@@ -339,6 +339,10 @@ interface QueueAPI {
339
339
  add(name: string, data: unknown, opts?: AddOptions): Promise<unknown>;
340
340
  /** Approximate count of jobs eligible-but-not-running. Used by broadcast backpressure. */
341
341
  getWaitingCount(): Promise<number>;
342
+ /** Active + waiting jobs (runnable now). Returns null when the driver can't expose it. */
343
+ getInFlightCount?(): Promise<number | null>;
344
+ /** Delayed jobs scheduled for the future. Returns null when unsupported. */
345
+ getDelayedCount?(): Promise<number | null>;
342
346
  close(): Promise<void>;
343
347
  }
344
348
  interface Queues {
package/dist/testing.cjs CHANGED
@@ -14578,6 +14578,11 @@ function adaptBullQueue(q) {
14578
14578
  return {
14579
14579
  add: (name, data, opts) => q.add(name, data, opts),
14580
14580
  getWaitingCount: () => q.getWaitingCount(),
14581
+ getInFlightCount: async () => {
14582
+ const [active, waiting] = await Promise.all([q.getActiveCount(), q.getWaitingCount()]);
14583
+ return active + waiting;
14584
+ },
14585
+ getDelayedCount: () => q.getDelayedCount(),
14581
14586
  close: () => q.close()
14582
14587
  };
14583
14588
  }