Start sync client manager implementation

This commit is contained in:
2025-02-12 21:01:34 +01:00
parent 17e086b43c
commit 3822c209d3
6 changed files with 47 additions and 12 deletions

View File

@ -1,3 +1,28 @@
use crate::broadcast_messages::BroadcastMessage;
use tokio::sync::broadcast;
/// ID of sync client
#[derive(Debug, Clone)]
pub struct SyncClientID(uuid::Uuid);
pub struct SyncClientID(uuid::Uuid);
/// Sync client launcher loop
pub async fn sync_client_manager(tx: broadcast::Sender<BroadcastMessage>) {
let mut rx = tx.subscribe();
while let Ok(msg) = rx.recv().await {
match msg {
BroadcastMessage::StopSyncTaskForUser(user_id) => {
log::info!("Stop sync task for user {:?}", user_id);
// TODO
}
BroadcastMessage::StartSyncTaskForUser(user_id) => {
log::info!("Start sync task for user {:?}", user_id);
// TODO
}
_ => {}
}
}
panic!("Sync client manager stopped unexpectedly!");
}