pub struct DeadLetterModel { /* private fields */ }Expand description
Learned dead letter retry policy replacing fixed backoff and discard rules.
Inputs (3): retry_count, message_age_ms, queue_depth Outputs (2): retry_delay_ms, should_discard (>0.5 = discard)
Fallback: retry_delay = 1000 * 2^retry_count (capped at 60s), discard after 5 retries.
Implementations§
Source§impl DeadLetterModel
impl DeadLetterModel
Sourcepub fn drain_events(&mut self) -> Vec<EmlEvent>
pub fn drain_events(&mut self) -> Vec<EmlEvent>
Drain accumulated EML lifecycle events for ExoChain forwarding.
Sourcepub fn is_trained(&self) -> bool
pub fn is_trained(&self) -> bool
Whether the model has been trained.
Sourcepub fn training_sample_count(&self) -> usize
pub fn training_sample_count(&self) -> usize
Number of training samples collected.
Sourcepub fn predict(
&self,
retry_count: u32,
message_age_ms: u64,
queue_depth: usize,
) -> (u64, bool)
pub fn predict( &self, retry_count: u32, message_age_ms: u64, queue_depth: usize, ) -> (u64, bool)
Predict retry policy: (retry_delay_ms, should_discard).
When untrained, uses exponential backoff: 1000 * 2^retry_count capped at 60s, discards after 5 retries.
Trait Implementations§
Source§impl Clone for DeadLetterModel
impl Clone for DeadLetterModel
Source§impl Debug for DeadLetterModel
impl Debug for DeadLetterModel
Source§impl Default for DeadLetterModel
impl Default for DeadLetterModel
Source§impl<'de> Deserialize<'de> for DeadLetterModel
impl<'de> Deserialize<'de> for DeadLetterModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DeadLetterModel
impl RefUnwindSafe for DeadLetterModel
impl Send for DeadLetterModel
impl Sync for DeadLetterModel
impl Unpin for DeadLetterModel
impl UnsafeUnpin for DeadLetterModel
impl UnwindSafe for DeadLetterModel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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