pub struct DeadLetterQueue { /* private fields */ }Expand description
Dead Letter Queue operations for PostgreSQL
Implementations§
Source§impl DeadLetterQueue
impl DeadLetterQueue
pub fn new(pool: PgPool) -> Self
Sourcepub async fn insert(
&self,
event_id: Uuid,
handler_id: &str,
intent_id: Uuid,
error_message: &str,
error_details: Option<Value>,
retry_count: i32,
first_failed_at: DateTime<Utc>,
last_failed_at: DateTime<Utc>,
event_payload: Value,
) -> Result<Uuid>
pub async fn insert( &self, event_id: Uuid, handler_id: &str, intent_id: Uuid, error_message: &str, error_details: Option<Value>, retry_count: i32, first_failed_at: DateTime<Utc>, last_failed_at: DateTime<Utc>, event_payload: Value, ) -> Result<Uuid>
Insert a handler failure into the DLQ
Sourcepub async fn list(&self, limit: i64) -> Result<Vec<CoreDeadLetter>>
pub async fn list(&self, limit: i64) -> Result<Vec<CoreDeadLetter>>
List open or retrying DLQ entries
Sourcepub async fn list_by_handler(
&self,
handler_id: &str,
limit: i64,
) -> Result<Vec<CoreDeadLetter>>
pub async fn list_by_handler( &self, handler_id: &str, limit: i64, ) -> Result<Vec<CoreDeadLetter>>
List DLQ entries for a specific handler
Sourcepub async fn get(&self, dlq_id: Uuid) -> Result<CoreDeadLetter>
pub async fn get(&self, dlq_id: Uuid) -> Result<CoreDeadLetter>
Get a single DLQ entry by ID
Sourcepub async fn start_retry(&self, dlq_id: Uuid) -> Result<CoreDeadLetter>
pub async fn start_retry(&self, dlq_id: Uuid) -> Result<CoreDeadLetter>
Mark a DLQ entry as retrying and return it (with lock)
Sourcepub async fn mark_replayed(
&self,
dlq_id: Uuid,
resolution_note: Option<&str>,
) -> Result<()>
pub async fn mark_replayed( &self, dlq_id: Uuid, resolution_note: Option<&str>, ) -> Result<()>
Mark a DLQ entry as successfully replayed
Sourcepub async fn mark_retry_failed(
&self,
dlq_id: Uuid,
error_message: &str,
error_details: Option<Value>,
) -> Result<()>
pub async fn mark_retry_failed( &self, dlq_id: Uuid, error_message: &str, error_details: Option<Value>, ) -> Result<()>
Mark a DLQ entry as failed (retry failed, back to open)
Trait Implementations§
Source§impl Clone for DeadLetterQueue
impl Clone for DeadLetterQueue
Source§fn clone(&self) -> DeadLetterQueue
fn clone(&self) -> DeadLetterQueue
Returns a duplicate of the value. Read more
1.0.0 · 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 DeadLetterQueue
impl !RefUnwindSafe for DeadLetterQueue
impl Send for DeadLetterQueue
impl Sync for DeadLetterQueue
impl Unpin for DeadLetterQueue
impl UnsafeUnpin for DeadLetterQueue
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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