pub struct ErrorPolicyExecutor { /* private fields */ }Expand description
Error policy executor that applies workflow-level error handling
Implementations§
Source§impl ErrorPolicyExecutor
impl ErrorPolicyExecutor
Sourcepub fn new(policy: WorkflowErrorPolicy) -> Self
pub fn new(policy: WorkflowErrorPolicy) -> Self
Create a new error policy executor
Sourcepub async fn handle_item_failure(
&self,
item_id: &str,
item: &Value,
error: &MapReduceError,
dlq: Option<&DeadLetterQueue>,
) -> Result<FailureAction, MapReduceError>
pub async fn handle_item_failure( &self, item_id: &str, item: &Value, error: &MapReduceError, dlq: Option<&DeadLetterQueue>, ) -> Result<FailureAction, MapReduceError>
Handle a failed work item
Sourcepub fn record_success(&self)
pub fn record_success(&self)
Record a successful item
Sourcepub fn update_metrics(&self, error: &MapReduceError)
pub fn update_metrics(&self, error: &MapReduceError)
Update error metrics
Sourcepub fn get_metrics(&self) -> ErrorMetrics
pub fn get_metrics(&self) -> ErrorMetrics
Get current error metrics
Sourcepub fn get_collected_errors(&self) -> Vec<String>
pub fn get_collected_errors(&self) -> Vec<String>
Get collected errors for aggregate reporting
Sourcepub fn collect_error(&self, error: String)
pub fn collect_error(&self, error: String)
Collect an error for aggregate reporting
Auto Trait Implementations§
impl Freeze for ErrorPolicyExecutor
impl RefUnwindSafe for ErrorPolicyExecutor
impl Send for ErrorPolicyExecutor
impl Sync for ErrorPolicyExecutor
impl Unpin for ErrorPolicyExecutor
impl UnsafeUnpin for ErrorPolicyExecutor
impl UnwindSafe for ErrorPolicyExecutor
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
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
Converts
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>
Converts
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