pub struct PriorityConsumer { /* private fields */ }Expand description
Priority-aware consumer
Implementations§
Source§impl PriorityConsumer
impl PriorityConsumer
pub fn new(queue: Arc<PriorityQueue>) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Sourcepub async fn consume_batch(&self) -> Vec<PriorityMessage>
pub async fn consume_batch(&self) -> Vec<PriorityMessage>
Consume messages in priority order
Sourcepub async fn consume_one(&self) -> Option<PriorityMessage>
pub async fn consume_one(&self) -> Option<PriorityMessage>
Consume single message with timeout
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PriorityConsumer
impl RefUnwindSafe for PriorityConsumer
impl Send for PriorityConsumer
impl Sync for PriorityConsumer
impl Unpin for PriorityConsumer
impl UnwindSafe for PriorityConsumer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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