pub struct MulticastSegment {
pub branches: Vec<OutcomeSegment>,
pub parallel: bool,
pub parallel_limit: Option<usize>,
pub stop_on_exception: bool,
pub timeout: Option<Duration>,
pub aggregator: Arc<dyn Fn(Vec<Exchange>) -> Exchange + Send + Sync>,
}Expand description
Outcome-aware Multicast segment. Holds N child OutcomeSegments and a strategy (sequential or parallel). Parallel cancellation logic mirrors T13 SplitSegment — lower-the-value CAS records lowest-branch-index that Stopped (spec §5.2.2 line 497); pre-start gate skips not-yet-started branches; in-flight branches run to completion (spec §5.6 line 544: no abrupt abort); JoinSet ensures cancel-safe drop on outer future drop.
Each branch receives its OWN clone of the exchange (Multicast semantics — branches do NOT share body mutations).
Aggregation SKIPPED when any branch Stopped (spec §5.2.2).
Fields§
§branches: Vec<OutcomeSegment>§parallel: bool§parallel_limit: Option<usize>Maximum number of concurrent branches in parallel mode (None = unlimited).
stop_on_exception: boolWhether to stop processing on the first exception.
When true, a Failed outcome from any branch halts processing
immediately (sequential) or is propagated after all in-flight branches
complete (parallel). When false, failures are collected and processing
continues; the last error (last-wins, matching legacy LastWins aggregation)
is propagated after all branches complete.
Stopped outcomes always propagate per ADR-0025 §7 regardless of this flag.
timeout: Option<Duration>Per-branch timeout in parallel mode (None = no timeout).
aggregator: Arc<dyn Fn(Vec<Exchange>) -> Exchange + Send + Sync>Trait Implementations§
Source§impl Clone for MulticastSegment
impl Clone for MulticastSegment
Source§fn clone(&self) -> MulticastSegment
fn clone(&self) -> MulticastSegment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl OutcomePipeline for MulticastSegment
impl OutcomePipeline for MulticastSegment
Source§fn clone_box(&self) -> Box<dyn OutcomePipeline>
fn clone_box(&self) -> Box<dyn OutcomePipeline>
Box<dyn OutcomePipeline> cannot directly derive Clone.