pub trait EventBusTrait: Send + Sync {
// Required methods
fn get_sender(&self) -> UnboundedSender<EngineMessage>;
fn subscribe<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<EngineMessage>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_with_offsets<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<LegacyMessageEnvelope>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe_with_sequence<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<MessageEnvelope>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn start_processing<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait;
fn replay_from_offsets<'life0, 'async_trait>(
&'life0 self,
offsets: TopicOffsets,
handler: ReplayHandler,
) -> Pin<Box<dyn Future<Output = Result<TopicOffsets, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_current_offsets(&self) -> TopicOffsets;
fn get_current_sequence(&self) -> u64;
}Required Methods§
Sourcefn get_sender(&self) -> UnboundedSender<EngineMessage>
fn get_sender(&self) -> UnboundedSender<EngineMessage>
Get a sender to publish events
Sourcefn subscribe<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<EngineMessage>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<EngineMessage>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to specific topics and get a receiver for events
Sourcefn subscribe_with_offsets<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<LegacyMessageEnvelope>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_with_offsets<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<LegacyMessageEnvelope>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to specific topics and get a receiver for events WITH legacy offset metadata. Use this when you need to track exactly which offsets you’ve processed (for snapshots).
Sourcefn subscribe_with_sequence<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<MessageEnvelope>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_with_sequence<'life0, 'async_trait>(
&'life0 self,
topics: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<UnboundedReceiver<MessageEnvelope>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Subscribe to specific topics and get a receiver for events WITH sequence metadata. Use this when you need monotonic ordering.
Sourcefn start_processing<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
fn start_processing<'async_trait>(
self: Arc<Self>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
Start processing events (forwarding between channels)
Sourcefn replay_from_offsets<'life0, 'async_trait>(
&'life0 self,
offsets: TopicOffsets,
handler: ReplayHandler,
) -> Pin<Box<dyn Future<Output = Result<TopicOffsets, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn replay_from_offsets<'life0, 'async_trait>(
&'life0 self,
offsets: TopicOffsets,
handler: ReplayHandler,
) -> Pin<Box<dyn Future<Output = Result<TopicOffsets, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Replay events from specific offsets until caught up to the current head.
This is used during startup to replay events from the last snapshot to the current state before marking the service as ready.
Returns Ok(final_offsets) when caught up, where final_offsets are the high water marks that were reached. Returns Err if replay fails. The handler is called for each replayed message.
Sourcefn get_current_offsets(&self) -> TopicOffsets
fn get_current_offsets(&self) -> TopicOffsets
Get the current consumer offsets for all topics.
Returns the latest offset processed for each topic/partition. Used by snapshot services to record the exact position in the event stream that corresponds to the snapshot state.
For in-process implementations, returns an empty map.
Sourcefn get_current_sequence(&self) -> u64
fn get_current_sequence(&self) -> u64
Get the current sequence number (highest dispatched).