Skip to main content

run_config_reload_worker

Function run_config_reload_worker 

Source
pub async fn run_config_reload_worker<N, F, Fut>(
    notifier: Arc<N>,
    config: ConfigReloadWorkerConfig,
    shutdown: CancellationToken,
    reload: F,
) -> Result<()>
where N: ConfigChangeNotifier + ?Sized, F: FnMut(ConfigReloadMessage) -> Fut, Fut: Future<Output = Result<()>>,
Expand description

Runs a reload subscription loop until shutdown is cancelled.

The loop never carries configuration values over pub/sub. A matching notification only tells this process to reload from its authoritative store. Failed reload hints are coalesced and retried with bounded exponential backoff, even if no further notification arrives. Callbacks must support repeated authoritative reads; an empty key list means reload all config. Shutdown drops in-flight callbacks, which must be safe to cancel and repeat.

The loop uses the transport supervision of run_config_reload_supervisor, but has no authoritative reconcile callback. It retries received hints; repairing notifications lost during disconnection requires the supervisor API with a full reconcile callback.

ยงErrors

Returns [ConfigError] when publishing, subscription, reconciliation, or reload handling fails.