pub struct ConfigConvergenceConfig {
pub enabled: bool,
pub backend: String,
pub redis_url: Option<String>,
pub key_prefix: String,
pub poll_interval_ms: u64,
pub drift_check_interval_ms: u64,
pub fail_open: bool,
}Expand description
Config convergence config (DW-054, gateway.config_convergence).
When present and the ent cargo feature is compiled in AND a valid
license with the config_convergence feature claim is loaded, the
gateway publishes its config generation to a shared backend and
polls for generations published by other instances, converging to
the highest generation within poll_interval_ms. The backend is
the seam for etcd/Consul (deferred); v1 ships a Redis
implementation. The coordinator runs ALONGSIDE the local file
watcher: a local file change triggers a local reload plus a publish
to the backend; a remote change (detected by polling) triggers a
remote reload. Both go through compile_and_publish. When the
ent feature is NOT compiled in, or the license lacks the claim,
the block is accepted but inert (the local file watcher runs
alone).
Fields§
§enabled: boolMaster switch. Default false: convergence is inert and the gateway serves only its local config (the local file watcher still runs). When true (and licensed), the coordinator publishes and polls.
backend: StringConvergence backend type. v1 ships "redis"; etcd and Consul
are deferred behind the ConfigConvergenceBackend trait (the
value is the seam a future backend plugs into). Validation
rejects any value other than "redis".
redis_url: Option<String>Redis connection URL (e.g. redis://127.0.0.1:6379), required
when backend = "redis". The connection is established once at
startup and pooled via a multiplexed ConnectionManager.
key_prefix: StringPrefix for convergence keys in Redis (default dwara:config).
Instance generations live under {prefix}:instances and config
bodies under {prefix}:config.
poll_interval_ms: u64How often to poll the backend for generations published by other instances, in milliseconds (default 1000; validated to 100..=60 000). The done-when targets sub-second convergence; lower values converge faster at the cost of backend load.
drift_check_interval_ms: u64How often to read all instances’ generations and report drift, in milliseconds (default 5000; validated to 1 000..=300 000). Drift is reported (structured log + metric) when instances serve different config hashes.
fail_open: boolFail-open behavior when the convergence backend is unreachable
(default true): true keeps serving the local config
generation (convergence pauses until the backend recovers);
false refuses to start at cold start when the backend cannot
be reached. Fail-open is the safer default for availability –
a backend outage should not take down the gateway.
Trait Implementations§
Source§impl Clone for ConfigConvergenceConfig
impl Clone for ConfigConvergenceConfig
Source§fn clone(&self) -> ConfigConvergenceConfig
fn clone(&self) -> ConfigConvergenceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ConfigConvergenceConfig
impl Debug for ConfigConvergenceConfig
Source§impl<'de> Deserialize<'de> for ConfigConvergenceConfig
impl<'de> Deserialize<'de> for ConfigConvergenceConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ConfigConvergenceConfig
impl JsonSchema for ConfigConvergenceConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for ConfigConvergenceConfig
impl PartialEq for ConfigConvergenceConfig
Source§impl Serialize for ConfigConvergenceConfig
impl Serialize for ConfigConvergenceConfig
impl StructuralPartialEq for ConfigConvergenceConfig
Auto Trait Implementations§
impl Freeze for ConfigConvergenceConfig
impl RefUnwindSafe for ConfigConvergenceConfig
impl Send for ConfigConvergenceConfig
impl Sync for ConfigConvergenceConfig
impl Unpin for ConfigConvergenceConfig
impl UnwindSafe for ConfigConvergenceConfig
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more