/** * @module drain * @category Internal * * Pipeline operations consumed by the drain/correlate loop. Each op is a * single async step the orchestrator invokes per drain cycle: * * - `claim` — atomically discover and lock streams for processing * - `fetch` — read events for each leased stream * - `ack` — release leases for successfully handled streams * - `block` — flag leases that exceeded the retry budget * - `subscribe` — register newly correlated streams with the store * * This module exposes only the bare implementations as plain async functions, * mirroring the shape of {@link "event-sourcing"}. Trace decoration is * layered on top in {@link "tracing"} and selected by the orchestrator at * construction time. No tracing imports here. * * @internal */ import type { BlockedLease, Fetch, Lease, Schemas, SubscribeInput, SubscribeResult } from "../types/index.js"; /** @internal */ export interface DrainOps { claim: typeof claim; fetch: typeof fetch; ack: typeof ack; block: typeof block; subscribe: typeof subscribe; } export declare const claim: (lagging: number, leading: number, by: string, millis: number, lane?: string) => Promise; export declare function fetch(leased: Lease[], eventLimit: number): Promise>; export declare const ack: (leases: Lease[]) => Promise; export declare const block: (leases: BlockedLease[]) => Promise; export declare const subscribe: (streams: SubscribeInput[], correlated_at?: number, correlator?: { key: string; by: string; millis: number; }) => Promise; //# sourceMappingURL=drain.d.ts.map