Expand description
Code to watch configuration files for any changes.
Re-exportsยง
use std::collections::HashSet;๐use std::sync::Arc;๐use std::sync::Mutex;๐use std::sync::Weak;๐use std::time::Duration;๐use anyhow::Context;๐use arti_client::TorClient;๐use arti_client::config::Reconfigure;๐use futures::StreamExt;๐use futures::stream::BoxStream;๐use futures::FutureExt as _;๐use futures::Stream;๐use futures::select_biased;๐use tor_basic_utils::error_sources::ErrorSources;๐use tor_config::ReconfigureError;๐use tor_config::file_watcher;๐use tor_config::file_watcher::FileEventReceiver;๐use tor_config::file_watcher::FileEventSender;๐use tor_config::file_watcher::FileWatcher;๐use tor_config::file_watcher::FileWatcherBuilder;๐use tor_config::load::ConfigResolveOptions;๐use tor_config::load::DisfavouredKey;๐use tor_config::ConfigGetValueError;๐use tor_config::ConfigurationTree;๐use tor_config::ConfigurationSource;๐use tor_config::ConfigurationSources;๐use tor_config::sources::FoundConfigFiles;๐use tor_error::warn_report;๐use tor_error::HasKind;๐use tor_error::into_internal;๐use tor_rtcompat::Runtime;๐use tor_rtcompat::SpawnExt;๐use tracing::debug;๐use tracing::error;๐use tracing::info;๐use tracing::instrument;๐use tracing::instrument;๐use tracing::warn;๐use crate::process::sighup_stream;๐use crate::rpc;๐use crate::ArtiCombinedConfig;๐use crate::ArtiConfig;๐
Structsยง
- Application ๐
- Internal type to represent the Arti application as a
ReconfigurableModule. - CfgMgr
- Structure to reload configuration as necessary.
- CfgMgr
Inner ๐ - Mutable part of a CfgMgr.
- Launchable
TorClient ๐ - A TorClient that we may or may not have told to start bootstrapping.
- Unlaunched
Watcher - A watcher process that we have not yet launched.
Enumsยง
- Change
Configuration Error - An error that occurred while trying to reload and/or replace our configuration
Constantsยง
- DEBOUNCE_
INTERVAL ๐ - How long to wait after an event got received, before we try to process it.
Traitsยง
- Reconfigurable
Module - An object that can be reconfigured when our configuration changes.
Functionsยง
- extract_
reconfigure_ ๐error - If possible, extract the ReconfigureError from
err. Otherwise, returnerras an internal ReconfigureError. - prepare ๐
- Find the configuration files and prepare the watcher
- reconfigure ๐
- Reload the configuration files, apply the runtime configuration, and reconfigure the client as much as we can.
- run_
watcher ๐ - Start watching for configuration changes.