Struct DeadLetterQueue
pub struct DeadLetterQueue {
letters: VecDeque<DeadLetter>,
config: DlqConfig,
next_sequence: u64,
total_received: u64,
total_replayed: u64,
total_expired: u64,
}Expand description
Dead letter queue.
Fields§
§letters: VecDeque<DeadLetter>§config: DlqConfig§next_sequence: u64§total_received: u64§total_replayed: u64§total_expired: u64Implementations§
§impl DeadLetterQueue
impl DeadLetterQueue
pub fn new(config: DlqConfig) -> DeadLetterQueue
pub fn new(config: DlqConfig) -> DeadLetterQueue
Create a new DLQ with the given configuration.
pub fn enqueue(
&mut self,
envelope: MessageEnvelope,
reason: DeadLetterReason,
destination: KernelId,
attempts: u32,
)
pub fn enqueue( &mut self, envelope: MessageEnvelope, reason: DeadLetterReason, destination: KernelId, attempts: u32, )
Route a message to the DLQ.
pub fn replay<F>(&mut self, filter: F) -> Vec<DeadLetter>
pub fn replay<F>(&mut self, filter: F) -> Vec<DeadLetter>
Replay messages from the DLQ matching a filter.
Returns messages removed from the DLQ for re-delivery.
pub fn replay_for(&mut self, destination: &KernelId) -> Vec<DeadLetter>
pub fn replay_for(&mut self, destination: &KernelId) -> Vec<DeadLetter>
Replay all messages destined for a specific actor.
pub fn expire_old(&mut self) -> u64
pub fn expire_old(&mut self) -> u64
Expire messages older than max_age.
pub fn browse(&self, limit: usize) -> Vec<&DeadLetter>
pub fn browse(&self, limit: usize) -> Vec<&DeadLetter>
Browse the DLQ contents (non-destructive).
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear the DLQ.
pub fn metrics(&self) -> DlqMetrics
pub fn metrics(&self) -> DlqMetrics
Get DLQ metrics.
Auto Trait Implementations§
impl Freeze for DeadLetterQueue
impl RefUnwindSafe for DeadLetterQueue
impl Send for DeadLetterQueue
impl Sync for DeadLetterQueue
impl Unpin for DeadLetterQueue
impl UnwindSafe for DeadLetterQueue
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
§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> 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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.