/** * @module drain-ratio * @category Internal * * Adaptive lag-to-lead ratio for the dual-frontier drain strategy. * * The orchestrator splits its per-cycle stream budget between two frontiers: * * - **lagging** — newly subscribed or behind streams catching up. * - **leading** — actively-processing streams at the head of the log. * * After each cycle, this helper looks at how many events were actually * handled in each frontier and shifts the next cycle's split toward * whichever frontier had the higher per-stream throughput. The result is * clamped to `[0.2, 0.8]` so neither frontier can be starved. * * @internal */ import type { HandleResult } from "./drain-cycle.js"; /** * Compute the next lag-to-lead ratio from the cycle's handled events and * the frontier sizes used to claim them. Returns `RATIO_DEFAULT` when no * progress was made (nothing to base a decision on). */ export declare function compute_lag_lead_ratio(handled: ReadonlyArray, lagging: number, leading: number): number; //# sourceMappingURL=drain-ratio.d.ts.map