pub struct ConfigWatcher { /* private fields */ }Expand description
SSE-based watcher that delivers ConfigChangedEvents via a broadcast channel.
Multiple subscribers can subscribe() to receive events independently.
Call start() to begin streaming. Call stop() to shut down.
Implementations§
Source§impl ConfigWatcher
impl ConfigWatcher
Sourcepub fn subscribe(&self) -> Receiver<ConfigChangedEvent>
pub fn subscribe(&self) -> Receiver<ConfigChangedEvent>
Subscribe to config-changed events.
Returns a broadcast::Receiver. Call start() to begin streaming events.
Sourcepub fn start(&self)
pub fn start(&self)
Start the SSE streaming loop in the background.
This spawns a Tokio task that connects to the /events endpoint and
delivers deserialized ConfigChangedEvents to all subscribers.
Reconnects automatically on connection failure after reconnect_delay.
Sourcepub fn with_reconnect_delay(self, delay: Duration) -> Self
pub fn with_reconnect_delay(self, delay: Duration) -> Self
Set a custom reconnect delay (default: 5 seconds).
Auto Trait Implementations§
impl Freeze for ConfigWatcher
impl RefUnwindSafe for ConfigWatcher
impl Send for ConfigWatcher
impl Sync for ConfigWatcher
impl Unpin for ConfigWatcher
impl UnsafeUnpin for ConfigWatcher
impl UnwindSafe for ConfigWatcher
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