跳到內容

waterfall

本頁內容尚未翻譯。

const waterfall: <I, O, E, R>(
event: Middleware<I, O, E>,
input: I,
last: (input: I) => Effect.Effect<O, E, R>,
) => Effect.Effect<O, E, Graft | Exclude<R, Scope.Scope>>

Defined in: Event.ts:525

Passes input through every handler as middleware, ending with last. Handlers use their registration context; last uses the dispatch context. Each invocation, including last, owns a scope that closes after its cleanup. Other services required by last remain requirements of the dispatch effect. Each handler’s next runs the downstream chain once. The first execution selects its input; later executions share the same success, failure, or interruption. Cancelling that first execution does not retry downstream. Unloading a running middleware interrupts the chain, before or after next. Downstream failures are preserved; a downstream success cannot bypass post-processing. A handler removed before it is claimed is skipped. The dispatcher can cancel a wait for next running in an independently owned fiber; that fiber remains its external owner’s responsibility.

Type Parameter
I
O
E
R
Parameter Type
event Middleware<I, O, E>
input I
last (input: I) => Effect.Effect<O, E, R>

Effect.Effect<O, E, | Graft | Exclude<R, Scope.Scope>>