pub struct MemoryBroker { /* private fields */ }Expand description
In-memory broker for testing and development.
Implementations§
Source§impl MemoryBroker
impl MemoryBroker
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 = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
fn enqueue<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: '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 = Result<Option<TaskMessage>, KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBroker: 'async_trait,
fn dequeue<'life0, 'life1, 'async_trait>(
&'life0 self,
queues: &'life1 [String],
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<Option<TaskMessage>, KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBroker: '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 = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBroker: 'async_trait,
fn ack<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 TaskId,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
MemoryBroker: 'async_trait,
Acknowledge successful processing — remove from processing queue.
Source§fn nack<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
fn nack<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: '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 = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
fn dead_letter<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
Move a message to the dead-letter queue.
Source§fn schedule<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
_eta: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
fn schedule<'life0, 'async_trait>(
&'life0 self,
message: TaskMessage,
_eta: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(), KojinError>> + Send + 'async_trait>>where
'life0: 'async_trait,
MemoryBroker: 'async_trait,
Schedule a message for future delivery.
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 moreSource§impl Default for MemoryBroker
impl Default for MemoryBroker
Source§fn default() -> MemoryBroker
fn default() -> MemoryBroker
Returns the “default value” for a type. Read more
Auto 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more