pub struct InMemoryQueueSource { /* private fields */ }Expand description
Process-local QueueSource for tests, examples, and single-process deployments.
publish appends a message; publishing one id twice models a
broker’s duplicate delivery. A pulled message is leased for the visibility timeout
(default 30 seconds).
Implementations§
Source§impl InMemoryQueueSource
impl InMemoryQueueSource
Sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Creates an empty source named name that reads the system clock.
Sourcepub fn with_visibility_timeout(self, timeout: Duration) -> Self
pub fn with_visibility_timeout(self, timeout: Duration) -> Self
Sets how long a pulled message stays leased before it is redelivered.
Sourcepub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
pub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
Sets the clock that decides lease expiry and nack delays.
Trait Implementations§
Source§impl Debug for InMemoryQueueSource
impl Debug for InMemoryQueueSource
Source§impl QueueSource for InMemoryQueueSource
impl QueueSource for InMemoryQueueSource
Source§fn pull<'life0, 'async_trait>(
&'life0 self,
max_messages: usize,
wait: Duration,
) -> Pin<Box<dyn Future<Output = Result<Vec<QueueMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn pull<'life0, 'async_trait>(
&'life0 self,
max_messages: usize,
wait: Duration,
) -> Pin<Box<dyn Future<Output = Result<Vec<QueueMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
receipt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
receipt: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes the message leased under
receipt. Read moreAuto Trait Implementations§
impl !Freeze for InMemoryQueueSource
impl !RefUnwindSafe for InMemoryQueueSource
impl !UnwindSafe for InMemoryQueueSource
impl Forget for InMemoryQueueSource
impl Move for InMemoryQueueSource
impl Send for InMemoryQueueSource
impl Sync for InMemoryQueueSource
impl Unpin for InMemoryQueueSource
impl UnsafeUnpin for InMemoryQueueSourcewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<Stored>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
*const Waiter is !null: UnsafeUnpin,
*const ArcInner<dyn Clock> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Clock>>: UnsafeUnpin,
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