pub struct Barrier<A, K, Route>{ /* private fields */ }Expand description
Fixed-membership cyclic barrier behavior.
Each generation accepts every configured key exactly once. The final
arrival commits the successor generation before emitting one
BarrierReleased delivery to every arrival recipient in arrival order.
Stale, future, duplicate, unknown, and exhausted arrivals are distinct
typed errors and preserve state. At u64::MAX, the final release commits
BarrierState::Exhausted instead of inferring wraparound. Initialization
is empty and the behavior never terminates itself. Membership, generation,
and release ordering are Bombay workflow policy; delivery is interpreted
by Address and Communication. Construction rejects empty or duplicate
membership. No method has a semantic panic condition.
Implementations§
Source§impl<A, K, Route> Barrier<A, K, Route>where
A: Address,
K: Clone + Eq,
Route: DeliveryRoute,
Route::Protocol: Protocol<Addr = A, Msg = BarrierReleased>,
impl<A, K, Route> Barrier<A, K, Route>where
A: Address,
K: Clone + Eq,
Route: DeliveryRoute,
Route::Protocol: Protocol<Addr = A, Msg = BarrierReleased>,
Sourcepub fn new(membership: BarrierMembership<K>) -> Self
pub fn new(membership: BarrierMembership<K>) -> Self
Bind validated membership to generation zero of a barrier actor.
Sourcepub const fn state(&self) -> &BarrierState<K, Route>
pub const fn state(&self) -> &BarrierState<K, Route>
Borrow the complete current generation state.