Expand description
Composition dispatcher — THE typed execution path for routed effects.
Wave-b V2 rebuilds composition dispatch as a typed, mandatory runtime seam.
The deleted composition_dispatch.rs and recompute_mob_peer_overlay*.rs
(wave-a tombstones ce2dbe35e / f5e366f38) were stringly-typed helpers
that callers opted into. This module is their structural opposite:
- Typed end-to-end. Producer identity is
ProducerInstancecarrying typedCompositionId,MachineInstanceId,MachineId. Effects travel asEffectPayload<E>whereEis the producer composition’s typed seam-effect sum (theProducerEffecttrait bound). Route resolution returns a typedRoutedInputDescriptorcarryingMachineInstanceId/InputVariantId/Vec<(FieldId, FieldId)>. Signal-kind routes travel through the parallelSignalPayload<S>/CompositionSignalDispatchersurface and resolve to typedRoutedSignalDescriptorvalues. - Mandatory, not optional. The trait has no fallback surface. Routed
effects whose route is declared in the composition schema MUST resolve
through the dispatcher; unresolved routes are a typed
DispatchRefusal::UnresolvedRouteerror, not a silent drop. Signal-kind routes live on a separate index insideRouteTableand MUST resolve throughCompositionSignalDispatcher. - Compile-time presence/absence. A
MeerkatMachineeither has a composition dispatcher attached (via thewith_compositionconstructor) or it does not (the standalone / single-machine test path). The two cases are distinguished by a typedCompositionBindingdiscriminant, never byOption<Arc<dyn CompositionDispatcher>>.
The default catalog-backed dispatcher (CatalogCompositionDispatcher)
consumes a RouteTable built from any
meerkat_machine_schema::CompositionSchema and delivers each resolved
RoutedInputDescriptor to a per-consumer-instance ConsumerSurface
supplied at wire-up. The per-composition codegen module emitted by
meerkat-machine-codegen (B-4 + B-4b) plugs in as the
ProducerEffect implementation — route_to_input is equivalent to
consulting the RouteTable built from the same schema.
Re-exports§
pub use route_table::RouteTable;pub use route_table::RouteTableError;pub use route_table::RoutedInputDescriptor;pub use route_table::RoutedSignalDescriptor;
Modules§
- route_
table - Typed route index consumed by
super::CatalogCompositionDispatcher.
Structs§
- Catalog
Composition Dispatcher - Default catalog-backed dispatcher.
- Catalog
Composition Signal Dispatcher - Default catalog-backed signal dispatcher.
- Dispatch
Outcome - Outcome when a routed effect is successfully dispatched.
- Producer
Instance - Typed identity of the producing machine instance inside a composition.
- Route
Key - Typed route key:
(composition, route). - Signal
Dispatch Outcome - Outcome when a routed signal is successfully dispatched.
Enums§
- Composition
Binding - Typed binding attached to a runtime that holds a dispatcher.
- Dispatch
Refusal - Reasons the dispatcher refuses a routed effect.
- Effect
Payload - Typed effect payload. Generic over the producer composition’s seam-effect
sum (see the codegen-emitted
{Composition}Effectenum). - Field
Value - Typed view over a producer-field value projected through a route binding.
- Owned
Field Value - Owned counterpart of
FieldValueused when delivering a routed input across the consumer-surface boundary. Moving owned values means the consumer can construct its typed input without re-borrowing the producer. - Signal
Dispatch Refusal - Reasons the signal dispatcher refuses a routed signal.
- Signal
Payload - Typed signal-route payload. Generic over the producer composition’s seam-signal sum.
Traits§
- Composition
Dispatcher - Composition dispatcher trait.
- Composition
Signal Dispatcher - Composition signal dispatcher trait.
- Consumer
Surface - Delivery surface for one consumer instance inside a composition.
- Context
Provider - Typed, owner-supplied context provider for an
OwnerProvidedbinding. - Producer
Effect - Marker trait for the seam-effect sum emitted by
meerkat-machine-codegen::render_composition_driver. Producer effect enums implement this to expose the typed variant id alongside their domain body — the dispatcher consults it without inspecting the enum. - Producer
Signal - Marker trait for the seam-signal source sum consumed by
CompositionSignalDispatcher. - Signal
Consumer Surface - Delivery surface for one signal-consuming instance inside a composition.