Start sync client manager implementation
This commit is contained in:
@ -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!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user