daemon: reorg: use channels for comms instead of copying daemon arc/mutex
This commit is contained in:
17
kordophoned/src/daemon/events.rs
Normal file
17
kordophoned/src/daemon/events.rs
Normal 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>>),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user