Function sync_file_to_configset

Source
pub async fn sync_file_to_configset(
    set: ConfigSet,
    config_file: impl AsRef<Path>,
    config_sync_timeout: Duration,
    config_sync_loop_interval: Option<Duration>,
    on_update: impl Fn(&ConfigUpdates, &ConfigSet) + Send + 'static,
) -> Result<(), Error>
Expand description

Start a background task that syncs a ConfigSet with a local JSON file. Returns Ok after the initial sync is completed. If the initialization takes longer than config_sync_timeout, an error is returned.

The file format is a simple JSON object mapping config names to their values.