/** * @module reaction-builder * @category Internal * * Reaction dispatch — what runs inside the drain pipeline once `run_drain_cycle` * has fetched events for a leased stream. Two shapes: * * - per-event `handle`: walks payloads sequentially, running each handler * inside the reaction scope so `action()` threads `reactingTo` * - bulk `handle_batch`: hands every event for a static-target projection to * a single batch callback, enabling one-transaction replays * * Both share `_finalize`, which collapses the retry-vs-block decision and * the "report error only when nothing was handled" rule. * * @internal */ import { type Handle, type HandleBatch } from "../internal/index.js"; import type { ReactionScope } from "../scoped.js"; import { type Actor, type Logger, type Schemas } from "../types/index.js"; /** * What the dispatcher needs from the orchestrator: a logger for retry and * error breadcrumbs, and the scope a handler runs inside. * * @internal */ export type ReactionDeps = { readonly logger: Logger; /** * What a handler runs inside — its `IAct` facade and its triggering-event * context — assembled by the orchestrator. How either half works is not * this module's business; it receives the scope whole and calls it. */ readonly reaction_scope: ReactionScope; }; /** * Builds the per-event reaction dispatcher passed to `run_drain_cycle`. * * The triggering event is installed as ambient context around each handler * call, so `action()` resolves it as `reactingTo` (#587, #1541). Ambient * rather than bound to the `IAct` argument, so a handler that dispatches * through a captured `app` inherits the chain too. * * @internal */ export declare function build_handle(deps: ReactionDeps): Handle; /** * Builds the bulk reaction dispatcher passed to `run_drain_cycle`. All events * for a static-target projection are handed to a single callback so the * projection can do one transaction per drain (catch-up replays especially). * * @internal */ export declare function build_handle_batch(logger: Logger): HandleBatch; //# sourceMappingURL=reaction-builder.d.ts.map