pub struct SplitSegment {
pub splitter: SplitExpression,
pub body: OutcomeSegment,
pub parallel: bool,
pub parallel_limit: Option<usize>,
pub stop_on_exception: bool,
pub aggregation: AggregationStrategy,
}Expand description
Outcome-aware structural EIP segment for the Split pattern.
Splits an incoming exchange into fragments, processes each fragment through
body, and aggregates the results. Supports sequential and parallel modes.
In sequential mode, fragments are processed in order. A Stopped or Failed
outcome from any fragment halts processing immediately and propagates.
In parallel mode, all fragments are spawned as tokio tasks. The first
Stopped outcome (lowest fragment index wins via CAS) propagates as the
outer Stopped. In-flight tasks run to completion (spec §5.6: no abrupt
abort — child sub-pipelines may have HTTP/SQL side effects). Tasks that
have not started yet are short-circuited via a pre-start gate.
Unlike SplitterService (which operates at the Tower layer and cannot
preserve Stopped(ex) with mutations), SplitSegment operates at the
PipelineOutcome layer and preserves the exchange including all mutations
at the Stop point.
Fields§
§splitter: SplitExpressionSplits an exchange into fragment exchanges.
body: OutcomeSegmentThe sub-pipeline executed for each fragment.
parallel: boolWhether to process fragments in parallel.
parallel_limit: Option<usize>Maximum number of concurrent fragments in parallel mode (None = unlimited).
stop_on_exception: boolWhether to stop processing on the first exception.
When true, a Failed outcome from any fragment halts processing
immediately. When false, the error is collected and processing
continues; the last-seen error is propagated (last-wins, matching legacy multicast.rs::process_parallel)
is propagated after all fragments complete.
Stopped outcomes always propagate immediately regardless of this
flag (per ADR-0025 §7 — Stop is successful control flow).
aggregation: AggregationStrategyStrategy for aggregating fragment results.
Trait Implementations§
Source§impl Clone for SplitSegment
impl Clone for SplitSegment
Source§impl OutcomePipeline for SplitSegment
impl OutcomePipeline for SplitSegment
Source§fn clone_box(&self) -> Box<dyn OutcomePipeline>
fn clone_box(&self) -> Box<dyn OutcomePipeline>
Box<dyn OutcomePipeline> cannot directly derive Clone.