Private
Public Access
1
0

daemon: reorg: use channels for comms instead of copying daemon arc/mutex

This commit is contained in:
2025-04-27 12:53:45 -07:00
parent ef74df9f28
commit 22554a7644
4 changed files with 124 additions and 78 deletions

View File

@@ -0,0 +1,17 @@
use tokio::sync::oneshot;
use kordophone_db::models::Conversation;
pub type Reply<T: Send> = oneshot::Sender<T>;
pub enum Event {
/// Get the version of the daemon.
GetVersion(Reply<String>),
/// Asynchronous event for syncing all conversations with the server.
SyncAllConversations(Reply<()>),
/// Returns all known conversations from the database.
GetAllConversations(Reply<Vec<Conversation>>),
}