/** * The bounded drain for the application delivery outbox (WFT-85): deliver * everything that is due, then everything that becomes due within the budget, * running a maintenance pass between rounds so lapsed leases are recovered, * and report counts only. * * Split from `outbox-runner.ts` to keep both files under this * repository's file-size ceiling. * * @module core/outbox-drain */ import type { OutboxDrainReport } from './outbox-contract.ts'; import type { OutboxRuntime } from './outbox-internals.ts'; /** * Deliver everything that is due, then everything that becomes due within the * budget, running a maintenance pass before the first round and whenever a * round finds nothing due, so lapsed leases are recovered without rescanning * the outbox before every send. Reports counts only, and `pending` from the * durable header, so a forced stop never claims anything it did not commit. * * The budget is one stop signal for the whole drain: it ends the sleeps, the * maintenance passes, and an in-flight send alike, so a drain asked to stop at * a deadline stops there rather than after the current delivery. */ export declare function drainOutbox(runtime: OutboxRuntime, options: { readonly timeoutMs: number; readonly signal?: AbortSignal | undefined; readonly pollIntervalMs?: number | undefined; }): Promise;