pub struct RateLimitedQueue<Q: ?Sized> { /* private fields */ }Expand description
A queue decorator that enforces a rate limit on enqueue.
Implementations§
Trait Implementations§
Source§impl<Q: Queue + ?Sized> Queue for RateLimitedQueue<Q>
impl<Q: Queue + ?Sized> Queue for RateLimitedQueue<Q>
Source§fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enqueue<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
payload: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enqueues
payload onto topic.Source§fn dequeue<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dequeue<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<Job>, QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Acknowledges a job as successfully processed.
Source§fn nack<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
requeue: bool,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn nack<'life0, 'life1, 'async_trait>(
&'life0 self,
job: &'life1 Job,
requeue: bool,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Negative-acknowledges a job. If
requeue is true the job goes back
onto the queue; if false it moves to the dead-letter queue (if
configured).Source§fn dlq_move<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dlq_move<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: &'life1 str,
job: Job,
) -> Pin<Box<dyn Future<Output = Result<(), QueueError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Moves a job to the dead-letter queue for
topic.Auto Trait Implementations§
impl<Q> !RefUnwindSafe for RateLimitedQueue<Q>
impl<Q> !UnwindSafe for RateLimitedQueue<Q>
impl<Q> Freeze for RateLimitedQueue<Q>
impl<Q> Send for RateLimitedQueue<Q>
impl<Q> Sync for RateLimitedQueue<Q>
impl<Q> Unpin for RateLimitedQueue<Q>
impl<Q> UnsafeUnpin for RateLimitedQueue<Q>
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