pub struct MemoryBroker { /* private fields */ }Expand description
In-memory broker for testing and development.
Implementations§
Trait Implementations§
Source§impl Broker for MemoryBroker
impl Broker for MemoryBroker
Source§fn enqueue<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn enqueue<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Push a message onto a queue.
Source§fn dequeue<'life0, 'life1, 'async_trait>(
&'life0 self,
queues: &'life1 [String],
timeout: Duration,
) -> Pin<Box<dyn Future<Output = TaskResult<Option<TaskMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn dequeue<'life0, 'life1, 'async_trait>(
&'life0 self,
queues: &'life1 [String],
timeout: Duration,
) -> Pin<Box<dyn Future<Output = TaskResult<Option<TaskMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Blocking dequeue from one of the given queues.
Returns
None if shutdown is signaled or timeout occurs.Source§fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Acknowledge successful processing — remove from processing queue.
Source§fn nack<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn nack<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Negative acknowledge — message will be re-enqueued or dead-lettered.
Source§fn dead_letter<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dead_letter<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = TaskResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Move a message to the dead-letter queue.
Source§impl Clone for MemoryBroker
impl Clone for MemoryBroker
Source§fn clone(&self) -> MemoryBroker
fn clone(&self) -> MemoryBroker
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 MemoryBroker
impl !RefUnwindSafe for MemoryBroker
impl Send for MemoryBroker
impl Sync for MemoryBroker
impl Unpin for MemoryBroker
impl UnsafeUnpin for MemoryBroker
impl !UnwindSafe for MemoryBroker
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