pub struct RelayCell<T, M> { /* private fields */ }Expand description
The algebra-typed conflating relay (Phase 2, in-proc core).
Implementations§
Source§impl<T, M> RelayCell<T, M>
impl<T, M> RelayCell<T, M>
Sourcepub fn new(
ctx: &Context,
policy: BackpressurePolicy,
) -> Result<Self, RelayConfigError>
pub fn new( ctx: &Context, policy: BackpressurePolicy, ) -> Result<Self, RelayConfigError>
Build a relay over policy, validating the initial overflow against the
policy’s algebra flags (analysis §4.3): Conflate requires
M::CONFLATES.
Sourcepub fn overflow_is_legal(&self, ctx: &Context) -> bool
pub fn overflow_is_legal(&self, ctx: &Context) -> bool
Whether the current overflow choice is legal for M — a runtime guard
mirroring new’s construction-time check (the overflow cell is reactive).
Sourcepub fn is_empty(&self) -> Computed<bool>
pub fn is_empty(&self) -> Computed<bool>
Demand-driven reader: window is empty (nothing to drain).
Sourcepub fn ingress(&self, ctx: &Context, op: T) -> IngressOutcome
pub fn ingress(&self, ctx: &Context, op: T) -> IngressOutcome
Ingest one op. Applies the reactive overflow policy when the window is at
high_water; otherwise merges the op into the hot head under M.
Sourcepub fn drain(&self, ctx: &Context) -> Option<T>
pub fn drain(&self, ctx: &Context) -> Option<T>
Drain the coalesced window: take the hot head’s value and reset the window.
Returns None for an empty window. The egress folds successive drains into
its own accumulator; relay_converges guarantees that fold equals the flat
fold of every ingested op, for any drain schedule.