pub struct StreamingEngine { /* private fields */ }Expand description
The main streaming engine for pub/sub and CDC.
Implementations§
Source§impl StreamingEngine
impl StreamingEngine
Sourcepub fn with_config(config: EngineConfig) -> Self
pub fn with_config(config: EngineConfig) -> Self
Create an engine with custom configuration.
Sourcepub fn create_channel(
&self,
id: impl Into<ChannelId>,
) -> Result<(), EngineError>
pub fn create_channel( &self, id: impl Into<ChannelId>, ) -> Result<(), EngineError>
Create a new channel.
Sourcepub fn create_channel_with_config(
&self,
id: impl Into<ChannelId>,
config: ChannelConfig,
) -> Result<(), EngineError>
pub fn create_channel_with_config( &self, id: impl Into<ChannelId>, config: ChannelConfig, ) -> Result<(), EngineError>
Create a channel with custom configuration.
Sourcepub fn delete_channel(&self, id: &ChannelId) -> Result<(), EngineError>
pub fn delete_channel(&self, id: &ChannelId) -> Result<(), EngineError>
Delete a channel.
Sourcepub fn list_channels(&self) -> Vec<ChannelId>
pub fn list_channels(&self) -> Vec<ChannelId>
List all channels.
Sourcepub fn channel_exists(&self, id: &ChannelId) -> bool
pub fn channel_exists(&self, id: &ChannelId) -> bool
Check if a channel exists.
Sourcepub fn publish(
&self,
channel_id: &ChannelId,
event: Event,
) -> Result<usize, EngineError>
pub fn publish( &self, channel_id: &ChannelId, event: Event, ) -> Result<usize, EngineError>
Publish an event to a channel.
Sourcepub fn publish_change(
&self,
channel_id: &ChannelId,
change: ChangeEvent,
) -> Result<usize, EngineError>
pub fn publish_change( &self, channel_id: &ChannelId, change: ChangeEvent, ) -> Result<usize, EngineError>
Publish a CDC change event.
Sourcepub fn publish_to_many(
&self,
channel_ids: &[ChannelId],
event: Event,
) -> HashMap<ChannelId, Result<usize, EngineError>>
pub fn publish_to_many( &self, channel_ids: &[ChannelId], event: Event, ) -> HashMap<ChannelId, Result<usize, EngineError>>
Publish to multiple channels.
Sourcepub fn subscribe(
&self,
channel_id: &ChannelId,
subscriber_id: impl Into<SubscriberId>,
) -> Result<ChannelReceiver, EngineError>
pub fn subscribe( &self, channel_id: &ChannelId, subscriber_id: impl Into<SubscriberId>, ) -> Result<ChannelReceiver, EngineError>
Subscribe to a channel.
Sourcepub fn subscribe_with_filter(
&self,
channel_id: &ChannelId,
subscriber_id: impl Into<SubscriberId>,
filter: EventFilter,
) -> Result<ChannelReceiver, EngineError>
pub fn subscribe_with_filter( &self, channel_id: &ChannelId, subscriber_id: impl Into<SubscriberId>, filter: EventFilter, ) -> Result<ChannelReceiver, EngineError>
Subscribe with a filter.
Sourcepub fn unsubscribe(&self, channel_id: &ChannelId, subscriber_id: &SubscriberId)
pub fn unsubscribe(&self, channel_id: &ChannelId, subscriber_id: &SubscriberId)
Unsubscribe from a channel.
Sourcepub fn get_subscriber(&self, id: &SubscriberId) -> Option<Subscriber>
pub fn get_subscriber(&self, id: &SubscriberId) -> Option<Subscriber>
Get a subscriber.
Sourcepub fn list_subscribers(&self) -> Vec<SubscriberId>
pub fn list_subscribers(&self) -> Vec<SubscriberId>
List all subscribers.
Sourcepub fn remove_subscriber(&self, id: &SubscriberId)
pub fn remove_subscriber(&self, id: &SubscriberId)
Remove a subscriber.
Sourcepub fn get_history(
&self,
channel_id: &ChannelId,
count: usize,
) -> Result<Vec<Event>, EngineError>
pub fn get_history( &self, channel_id: &ChannelId, count: usize, ) -> Result<Vec<Event>, EngineError>
Get recent events from a channel.
Sourcepub fn get_history_after(
&self,
channel_id: &ChannelId,
timestamp: u64,
) -> Result<Vec<Event>, EngineError>
pub fn get_history_after( &self, channel_id: &ChannelId, timestamp: u64, ) -> Result<Vec<Event>, EngineError>
Get events after a timestamp.
Sourcepub fn stats(&self) -> EngineStats
pub fn stats(&self) -> EngineStats
Get engine statistics.
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset statistics.
Sourcepub fn channel_stats(&self, id: &ChannelId) -> Option<ChannelStats>
pub fn channel_stats(&self, id: &ChannelId) -> Option<ChannelStats>
Get channel statistics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamingEngine
impl RefUnwindSafe for StreamingEngine
impl Send for StreamingEngine
impl Sync for StreamingEngine
impl Unpin for StreamingEngine
impl UnsafeUnpin for StreamingEngine
impl UnwindSafe for StreamingEngine
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