Expand description
Live runtime state derived from the configuration snapshot.
AppStateInner holds the hot-swappable Config, but the media engine’s
processor hooks are built once and only receive a TrackConfig, so the
module switches they need live here in a process-wide ArcSwap. The
reload path (AppStateInner::reload_config) updates both atomically
enough for our purposes: a call reads whatever snapshot is current when it
is set up.
Precedence for a module switch, highest first:
- the ops toggle file (
PBX_TOGGLE_FILE, default/app/.env) — the emergency switch operators already use, read per call; [modules]in the active-call config file (hot-reloaded);- enabled.
Structs§
- Module
Switches - Effective module switches for the current config snapshot.
Functions§
- apply_
config - Publish the switches derived from a freshly loaded config. Called at startup and on every successful reload.
- module_
override - Resolve a module switch: toggle-file override first, then the value from the current config snapshot.
- module_
switches - Current module switches (cheap
Arcclone; taken once per call setup). - toggle_
file_ path - Ops-managed toggle file. The deploy mounts the env file into the
container; overridable via
PBX_TOGGLE_FILEfor tests/embedders. - toggle_
value - Value of
keyin the toggle file:Some(false)when it is explicitly disabled,Some(true)when explicitly enabled,Nonewhen absent (so the caller’s configured default applies). - toggle_
value_ from - Same as
toggle_valuebut against an explicit path (tests).KEY=false|0|offdisables;KEY=true|1|onenables; anything else is treated as absent. Lines starting with#are ignored.