pub struct InMemoryQueue { /* private fields */ }Expand description
An in-memory queue. Each topic is a shared mutex-protected vector + Notify.
Implementations§
Source§impl InMemoryQueue
impl InMemoryQueue
Trait Implementations§
Source§impl Clone for InMemoryQueue
impl Clone for InMemoryQueue
Source§impl Debug for InMemoryQueue
impl Debug for InMemoryQueue
Source§impl Default for InMemoryQueue
impl Default for InMemoryQueue
Source§impl Queue for InMemoryQueue
impl Queue for InMemoryQueue
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 Freeze for InMemoryQueue
impl RefUnwindSafe for InMemoryQueue
impl Send for InMemoryQueue
impl Sync for InMemoryQueue
impl Unpin for InMemoryQueue
impl UnsafeUnpin for InMemoryQueue
impl UnwindSafe for InMemoryQueue
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