refactor: replace unbounded control snapshot channel with tokio watch

This commit is contained in:
Nils Andreas Svee committed 2026-10-28 18:04:19 +07:00
1 parent 73307370f2
commit 9f92b13186
3 files changed
+19 -56

No files matched your search

+2 -1
View File
@@ -40,6 +40,7 @@ use std::sync::{Arc, RwLock};
use std::thread;
use std::thread::{JoinHandle, sleep};
use std::time::{Duration, Instant};
use tokio::sync::watch;
struct ReflectorSetup {
peers: Arc<RwLock<Vec<SocketAddr>>>,
@@ -345,7 +346,7 @@ fn run(settings: &Settings) -> anyhow::Result<()> {
reselection_enabled,
} = setup_reflectors(settings)?;
let (control_snapshot_tx, control_snapshot_rx) = flume::unbounded();
let (control_snapshot_tx, control_snapshot_rx) = watch::channel(None);
let (error_tx, error_rx) = flume::unbounded::<anyhow::Error>();
let (icmp_binding_tx, icmp_binding_rx) = flume::unbounded();
#[cfg(feature = "irtt")]