saluki_config/dynamic/
mod.rs

1//! Dynamic configuration.
2//!
3//! A configuration producer publishes [`ConfigSetting`]s over a stream of [`ConfigUpdate`]s. Two
4//! things consume that stream. A caller wanting a live by-key view hands the initial snapshot to
5//! [`ConfigurationLoader::with_dynamic_configuration`][crate::ConfigurationLoader::with_dynamic_configuration],
6//! then passes each later update to the [`ConfigUpdater`][crate::ConfigUpdater] that
7//! [`into_generic`][crate::ConfigurationLoader::into_generic] returns. The updater keeps a
8//! [`GenericConfiguration`][crate::GenericConfiguration] current and reports each change through
9//! [`ConfigChangeEvent`] or a [`FieldUpdateWatcher`]. A caller wanting its own representation takes
10//! [`ConfigSetting`] and [`ConfigUpdate`] alone and folds them itself.
11
12// The by-key view has no consumer in this repository: `agent-data-plane` folds the stream into its own
13// typed model and takes only `ConfigSetting`, `ConfigUpdate` and `Provenance` from this module. The
14// view is kept because this crate is general-purpose infrastructure and the by-key path is the
15// cheapest way for another process to consume a configuration stream. Until it has a consumer, the
16// unit tests in this module and in `crate` are the only thing exercising it, so do not thin them out.
17
18mod diff;
19mod event;
20mod watcher;
21
22pub use self::diff::diff_config;
23pub use self::event::{settings_to_state, ConfigChangeEvent, ConfigSetting, ConfigUpdate, Provenance};
24pub use self::watcher::FieldUpdateWatcher;