Expand description
Five-mode typed-event dispatch (DESIGN §6.1; mode semantics follow Cordis).
Like Cordis, the mode is a property of the dispatch call:
Ctx::emit— observe: runCtx::onobservers in registration order, no results. (Cordisemitdoes not await; this crate has no executor, so observers run to completion instead of being spawned — documented deviation.)Ctx::parallel— the same observers, awaited concurrently.Ctx::serial—Ctx::on_serialhandlers awaited in registration order; returns every handler’s value in order.Ctx::waterfall— aWaterfallMiddlewarechain over a value; any middleware may short-circuit withFlow::Stop(design intent for single-decision events).Ctx::bail—Ctx::on_bailhandlers until the firstSome(“bail”) value is returned.
Every registration (on, on_serial, on_waterfall, on_bail) returns
a Disposer removing exactly that handler — registrations are
reversible side effects.
Structs§
- Waterfall
Next - The
next()handle passed to waterfall middleware: invokingnext(value)runs the rest of the chain (whose result is aFlow— an inner short-circuit propagates outward). Consumed byWaterfallMiddlewareimplementations.
Enums§
- Flow
- The result of one waterfall middleware step: continue into the rest of the chain, or short-circuit the whole waterfall (both carry the value).
Traits§
- Waterfall
Middleware - One step of a waterfall chain over event
Eand valueT.
Type Aliases§
- Bail
Handler - Bail handler for event
Eproducing an optional bail valueT. - Observer
- Observer for event
E: invoked by bothemitandparallel. - Serial
Handler - Serial handler for event
Eproducing a valueR.