pub struct PubSubManager { /* private fields */ }Expand description
Pub/Sub manager for handling channel subscriptions and message broadcasting
Implementations§
Source§impl PubSubManager
impl PubSubManager
Sourcepub fn new(cleanup_interval: Duration, subscription_timeout: Duration) -> Self
pub fn new(cleanup_interval: Duration, subscription_timeout: Duration) -> Self
Create a new pub/sub manager
Sourcepub fn start_cleanup(&mut self)
pub fn start_cleanup(&mut self)
Start the background cleanup task
Sourcepub fn stop_cleanup(&mut self)
pub fn stop_cleanup(&mut self)
Stop the background cleanup task
Sourcepub async fn subscribe(
&self,
pattern: ChannelPattern,
) -> KVResult<UnboundedReceiver<PubSubMessage>>
pub async fn subscribe( &self, pattern: ChannelPattern, ) -> KVResult<UnboundedReceiver<PubSubMessage>>
Sourcepub async fn unsubscribe(&self, pattern: &ChannelPattern) -> KVResult<usize>
pub async fn unsubscribe(&self, pattern: &ChannelPattern) -> KVResult<usize>
Sourcepub async fn get_stats(&self) -> KVResult<PubSubStats>
pub async fn get_stats(&self) -> KVResult<PubSubStats>
Sourcepub async fn get_active_patterns(&self) -> KVResult<Vec<ChannelPattern>>
pub async fn get_active_patterns(&self) -> KVResult<Vec<ChannelPattern>>
Trait Implementations§
Source§impl Default for PubSubManager
impl Default for PubSubManager
Auto Trait Implementations§
impl Freeze for PubSubManager
impl !RefUnwindSafe for PubSubManager
impl Send for PubSubManager
impl Sync for PubSubManager
impl Unpin for PubSubManager
impl !UnwindSafe for PubSubManager
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