pub struct DeadLetterQueue { /* private fields */ }Expand description
Durable storage for tasks that exhausted their retries.
Entries are persisted under dlq:{task_id} so they survive restarts and can
be inspected or replayed by an operator.
Implementations§
Source§impl DeadLetterQueue
impl DeadLetterQueue
Sourcepub async fn push(
&self,
task_id: &str,
attempts: u32,
error: impl Into<String>,
) -> Result<()>
pub async fn push( &self, task_id: &str, attempts: u32, error: impl Into<String>, ) -> Result<()>
Add a failed task to the queue.
Sourcepub async fn get(&self, task_id: &str) -> Result<Option<DeadLetter>>
pub async fn get(&self, task_id: &str) -> Result<Option<DeadLetter>>
Fetch the dead-letter entry for a task, if present.
Sourcepub async fn list(&self) -> Result<Vec<DeadLetter>>
pub async fn list(&self) -> Result<Vec<DeadLetter>>
List all dead-lettered entries.
Auto Trait Implementations§
impl !RefUnwindSafe for DeadLetterQueue
impl !UnwindSafe for DeadLetterQueue
impl Freeze for DeadLetterQueue
impl Send for DeadLetterQueue
impl Sync for DeadLetterQueue
impl Unpin for DeadLetterQueue
impl UnsafeUnpin for DeadLetterQueue
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