pub struct NotificationBus { /* private fields */ }Expand description
Message bus for distributing change notifications
Implementations§
Source§impl NotificationBus
impl NotificationBus
Sourcepub fn subscribe(&self, filter: NotificationFilter) -> Subscription
pub fn subscribe(&self, filter: NotificationFilter) -> Subscription
Subscribe to notifications with a filter
Sourcepub fn subscribe_all(&self) -> Subscription
pub fn subscribe_all(&self) -> Subscription
Subscribe to all notifications (convenience method)
Sourcepub fn subscribe_key(&self, key: &str) -> Subscription
pub fn subscribe_key(&self, key: &str) -> Subscription
Subscribe to notifications for a specific key
Sourcepub fn subscribe_prefix(&self, prefix: &str) -> Subscription
pub fn subscribe_prefix(&self, prefix: &str) -> Subscription
Subscribe to notifications for keys with a specific prefix
Sourcepub fn subscribe_change_type(&self, change_type: ChangeType) -> Subscription
pub fn subscribe_change_type(&self, change_type: ChangeType) -> Subscription
Subscribe to notifications of a specific change type
Sourcepub fn unsubscribe(&self, subscription_id: SubscriptionId)
pub fn unsubscribe(&self, subscription_id: SubscriptionId)
Unsubscribe from notifications
Sourcepub async fn publish(&self, notification: ChangeNotification)
pub async fn publish(&self, notification: ChangeNotification)
Publish a notification to all subscribers
Sourcepub fn broadcast_receiver(&self) -> Receiver<ChangeNotification>
pub fn broadcast_receiver(&self) -> Receiver<ChangeNotification>
Get a broadcast receiver for all notifications
Sourcepub fn get_stats(&self) -> NotificationStats
pub fn get_stats(&self) -> NotificationStats
Get current statistics
Sourcepub fn cleanup_closed_subscribers(&self)
pub fn cleanup_closed_subscribers(&self)
Clean up closed subscriber channels
Sourcepub fn subscriber_count(&self) -> usize
pub fn subscriber_count(&self) -> usize
Get the number of active subscribers
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NotificationBus
impl !UnwindSafe for NotificationBus
impl Freeze for NotificationBus
impl Send for NotificationBus
impl Sync for NotificationBus
impl Unpin for NotificationBus
impl UnsafeUnpin for NotificationBus
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