pub struct ReplayEntry {
pub request: PromptRequest,
pub queued_at: SystemTime,
pub attempts: u32,
pub next_attempt_at: Instant,
}Expand description
A single entry in the DlqReplayScheduler internal queue.
Wraps a PromptRequest together with replay bookkeeping: when the entry
was first queued for replay, how many replay attempts have been made, and
the next-earliest wall-clock time at which it may be retried (exponential
backoff).
Fields§
§request: PromptRequestThe request to be replayed.
queued_at: SystemTimeWall-clock time at which this entry was added to the replay scheduler.
attempts: u32Number of times this entry has been attempted (started at 0).
next_attempt_at: InstantEarliest instant at which the next attempt is permitted.
Implementations§
Source§impl ReplayEntry
impl ReplayEntry
Sourcepub fn new(request: PromptRequest) -> Self
pub fn new(request: PromptRequest) -> Self
Create a ReplayEntry from a PromptRequest.
The entry is immediately eligible for replay (next_attempt_at = now).
§Panics
This function does not panic.
Sourcepub fn is_aged_out(&self, max_age: Duration) -> bool
pub fn is_aged_out(&self, max_age: Duration) -> bool
Returns true if the entry is older than max_age (based on queued_at).
§Panics
This function does not panic.
Trait Implementations§
Source§impl Clone for ReplayEntry
impl Clone for ReplayEntry
Source§fn clone(&self) -> ReplayEntry
fn clone(&self) -> ReplayEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ReplayEntry
impl RefUnwindSafe for ReplayEntry
impl Send for ReplayEntry
impl Sync for ReplayEntry
impl Unpin for ReplayEntry
impl UnsafeUnpin for ReplayEntry
impl UnwindSafe for ReplayEntry
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request