pub enum MemoryConsumer {
Queue(MemoryQueueConsumer),
Transport(TransportQueueConsumer),
Log {
consumer: EventStoreConsumer,
topic: String,
},
}Expand description
A source that reads messages from an in-memory channel or event store.
Variants§
Implementations§
Source§impl MemoryConsumer
impl MemoryConsumer
pub fn new(config: &MemoryConfig) -> Result<Self>
pub async fn new_async(config: &MemoryConfig) -> Result<Self>
Trait Implementations§
Source§impl Debug for MemoryConsumer
impl Debug for MemoryConsumer
Source§impl MessageConsumer for MemoryConsumer
impl MessageConsumer for MemoryConsumer
Source§fn receive_batch<'life0, 'async_trait>(
&'life0 mut self,
max_messages: usize,
) -> Pin<Box<dyn Future<Output = Result<ReceivedBatch, ConsumerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_batch<'life0, 'async_trait>(
&'life0 mut self,
max_messages: usize,
) -> Pin<Box<dyn Future<Output = Result<ReceivedBatch, ConsumerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receives a batch of messages. Read more
fn status<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = EndpointStatus> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn as_any(&self) -> &dyn Any
Source§fn on_connect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
fn on_connect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
Returns an optional lifecycle hook that runs once after the consumer connection is created. Read more
Source§fn on_disconnect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
fn on_disconnect_hook(&self) -> Option<BoxFuture<'_, Result<()>>>
Returns an optional lifecycle hook that runs before the consumer is dropped. Read more
Source§fn receive<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Received, ConsumerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Received, ConsumerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receives a single message.
fn receive_batch_helper<'life0, 'async_trait>(
&'life0 mut self,
_max_messages: usize,
) -> Pin<Box<dyn Future<Output = Result<ReceivedBatch, ConsumerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryConsumer
impl !Unpin for MemoryConsumer
impl !UnsafeUnpin for MemoryConsumer
impl !UnwindSafe for MemoryConsumer
impl Freeze for MemoryConsumer
impl Send for MemoryConsumer
impl Sync for MemoryConsumer
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