pub struct ChunkStep<I, O> { /* private fields */ }Expand description
A validated one-step chunk definition.
Implementations§
Source§impl<I, O> ChunkStep<I, O>
impl<I, O> ChunkStep<I, O>
Sourcepub fn new(
name: StepName,
size: ChunkSize,
reader: Box<dyn ItemReader<I>>,
processor: Arc<dyn ItemProcessor<I, O>>,
writer: Arc<dyn ItemWriter<O>>,
transactions: Arc<dyn ChunkTransactionManager>,
completion: Arc<dyn ChunkCompletion>,
) -> Self
pub fn new( name: StepName, size: ChunkSize, reader: Box<dyn ItemReader<I>>, processor: Arc<dyn ItemProcessor<I, O>>, writer: Arc<dyn ItemWriter<O>>, transactions: Arc<dyn ChunkTransactionManager>, completion: Arc<dyn ChunkCompletion>, ) -> Self
Constructs a chunk step from facade-owned component and transaction ports.
Sourcepub fn with_chunk_listener(self, listener: Arc<dyn ChunkListener>) -> Self
pub fn with_chunk_listener(self, listener: Arc<dyn ChunkListener>) -> Self
Registers a chunk listener in deterministic before-order.
Sourcepub fn with_item_listeners(self, listeners: ItemListenerSet<I, O>) -> Self
pub fn with_item_listeners(self, listeners: ItemListenerSet<I, O>) -> Self
Installs the authoritative item, retry, and skip listener families.
The set replaces any previously installed families.
Sourcepub fn with_fault_runtime(self, fault: FaultRuntime) -> Self
pub fn with_fault_runtime(self, fault: FaultRuntime) -> Self
Installs bounded retry, backoff, skip, and rollback behavior.
Without a fault runtime every component failure fails the step after a known rollback, which is the M2 behavior.
Sourcepub fn with_listener(self, listener: Arc<dyn StepExecutionListener>) -> Self
pub fn with_listener(self, listener: Arc<dyn StepExecutionListener>) -> Self
Registers a step listener in deterministic before-order.
Sourcepub async fn execute(
&mut self,
correlation: &ExecutionCorrelation,
stop: &StopToken,
) -> ChunkExecutionReport
pub async fn execute( &mut self, correlation: &ExecutionCorrelation, stop: &StopToken, ) -> ChunkExecutionReport
Executes this step deterministically on the caller’s async runtime.
The reader is stateful, so the definition is mutably borrowed for the
duration of the run. Only counts returned by successful transaction
commits appear in the report. correlation identifies the execution for
item, retry, and skip listeners; it never reaches a component.
Trait Implementations§
Auto Trait Implementations§
impl<I, O> !RefUnwindSafe for ChunkStep<I, O>
impl<I, O> !Sync for ChunkStep<I, O>
impl<I, O> !UnwindSafe for ChunkStep<I, O>
impl<I, O> Freeze for ChunkStep<I, O>
impl<I, O> Send for ChunkStep<I, O>
impl<I, O> Unpin for ChunkStep<I, O>
impl<I, O> UnsafeUnpin for ChunkStep<I, O>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more