pub struct ConfigWatcher { /* private fields */ }Expand description
Watches a ReloadableConfig<IndexerConfig> on a fixed polling interval and
fires registered callbacks whenever the config changes.
Implementations§
Source§impl ConfigWatcher
impl ConfigWatcher
Sourcepub fn watch(
&self,
config: Arc<RwLock<ReloadableConfig<IndexerConfig>>>,
_source: ConfigSource,
)
pub fn watch( &self, config: Arc<RwLock<ReloadableConfig<IndexerConfig>>>, _source: ConfigSource, )
Start watching config for changes originating from source.
Spawns a background tokio task that compares version numbers and
invokes all registered callbacks with the diffs when a change is
detected.
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