pub trait EventStream: Send + Sync {
// Required methods
fn publish<'life0, 'async_trait>(
&'life0 self,
event: MemoryGraphEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn subscribe(
&self,
) -> Pin<Box<dyn Stream<Item = MemoryGraphEvent> + Send + '_>>;
// Provided method
fn publish_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<MemoryGraphEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Trait for event streaming
Required Methods§
Provided Methods§
Sourcefn publish_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<MemoryGraphEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn publish_batch<'life0, 'async_trait>(
&'life0 self,
events: Vec<MemoryGraphEvent>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Publish multiple events in batch