ConfigManager

Trait ConfigManager 

Source
pub trait ConfigManager: StoreManager {
    // Provided method
    fn watch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Receiver<HashMap<String, String>>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

A trait for managing a config store which can be watched to receive updates to the config

Provided Methods§

Source

fn watch<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Receiver<HashMap<String, String>>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Watches a config by name and returns a receiver that will be notified when the config changes

The default implementation returns a receiver that will never receive any updates.

Implementations on Foreign Types§

Source§

impl ConfigManager for Store

Source§

fn watch<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Receiver<HashMap<String, String>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Watch the key in the JetStream bucket for changes. This will return a channel that will receive updates to the config as they happen.

Implementors§

Source§

impl ConfigManager for DefaultStore

A default implementation of the config manager that does not watch for updates