[feat](trx-frontend): add context types for explicit initialization
Create explicit context types for frontend registration and runtime: FrontendRegistrationContext: - register_frontend(name, spawner) - register a frontend - is_frontend_registered(name) - check if registered - registered_frontends() -> Vec<String> - list all frontends - spawn_frontend(name, ...) -> DynResult - spawn a frontend FrontendRuntimeContext (NEW): - audio_rx: broadcast channel for audio RX - audio_tx: mpsc channel for audio TX - audio_info: watch channel for audio stream metadata - decode_rx: broadcast channel for decoded messages - aprs_history: Arc<Mutex<VecDeque>> for APRS decode history - cw_history: Arc<Mutex<VecDeque>> for CW decode history - ft8_history: Arc<Mutex<VecDeque>> for FT8 decode history - auth_tokens: HashSet for authentication Replaces global mutable state with explicit context that can be threaded through bootstrap. Maintains global API for compatibility. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Signed-off-by: Stanislaw Grams <stanislawgrams@gmail.com>
This commit is contained in:
@@ -8,5 +8,6 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
bytes = "1"
|
||||
trx-core = { path = "../../trx-core" }
|
||||
tokio = { workspace = true, features = ["sync"] }
|
||||
|
||||
Reference in New Issue
Block a user