refactor: replace unbounded control snapshot channel with tokio watch
This commit is contained in:
3 files changed
+19
-56
No files matched your search
+2
-1
@@ -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")]
|
||||
|
||||
Reference in new issue
Block a user