Simplify boilerplate for learning: drop real protocol code, minimal main.rs

Removed adapters/ (rumqttc MQTT, suppaftp FTPS, reqwest HTTP), plate_changer/
(tokio-serial), discovery/, and cache.rs (rusqlite) — src/printer/ already
covers 'talk to a printer' as simple stubs, so keeping a second, more complex
version alongside it was redundant. main.rs goes from 6 concurrent tasks to
2 (uplink + go2rtc). uplink/ drops channels, jitter, and Send-bound futures.

Verified with cargo build + cargo run --example printer_polymorphism.
This commit is contained in:
2026-08-28 18:22:38 +00:00
parent 5705f36c01
commit d0a17ee50e
16 changed files with 80 additions and 799 deletions
-8
View File
@@ -6,12 +6,8 @@ pub struct Config {
pub farm_id: String,
pub gateway_token: String,
pub uplink_url: String,
pub api_base: String,
pub sqlite_path: String,
pub go2rtc_bin: String,
pub go2rtc_config: String,
pub go2rtc_api_port: u16,
pub discovery_interval_secs: u64,
}
impl Config {
@@ -21,12 +17,8 @@ impl Config {
farm_id: require("CONTINUUM_FARM_ID")?,
gateway_token: require("CONTINUUM_GATEWAY_TOKEN")?,
uplink_url: env_or("CONTINUUM_UPLINK_URL", "wss://api.continuum.local/ws/edge/v1"),
api_base: env_or("CONTINUUM_API_BASE", "https://api.continuum.local"),
sqlite_path: env_or("CONTINUUM_SQLITE_PATH", "./data/edge-cache.db"),
go2rtc_bin: env_or("CONTINUUM_GO2RTC_BIN", "go2rtc"),
go2rtc_config: env_or("CONTINUUM_GO2RTC_CONFIG", "./go2rtc.yaml"),
go2rtc_api_port: env_or("CONTINUUM_GO2RTC_API_PORT", "1984").parse()?,
discovery_interval_secs: env_or("CONTINUUM_DISCOVERY_INTERVAL_SECS", "30").parse()?,
})
}
}