Skip to main content

PropagationCallback

Type Alias PropagationCallback 

Source
pub type PropagationCallback = Box<dyn Fn(&str, f64) + Sync + Send>;
Expand description

Lazily reloads values from disk when reads detect they are stale.

Holds the current ValuesByNamespace snapshot in an ArcSwap for lock-free reads. Every load() checks whether the snapshot is older than refresh_threshold + jitter; if so, the calling thread reads the values directory, then compare-and-swaps the timestamp. Whichever thread wins the CAS publishes its snapshot into the ArcSwap; losers discard their work.

Replaces the polling watcher thread: idle processes do no work, and concurrent readers coordinate through the timestamp CAS. Callback invoked when a namespace’s values are updated. Arguments: (namespace, delay_secs) where delay_secs is the propagation delay from ConfigMap generation to the app reading the new values.

Aliased Type§

pub struct PropagationCallback(/* private fields */);